Program to generate the pattern:
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
CLS
x = 5
y = 5
a = 1
FOR i = 5 TO 1 STEP -1
p = x
q = y
FOR j = 1 TO i
LOCATE p, q
PRINT a
a = a + 1
p = p + 1
NEXT j
x = x + 1
y = y + 3
PRINT
NEXT i
END
"That is infinity, this is infinity, infinity evolves infinity. Taking out infinity from infinity, infinity itself remains as a remainder." -Isavasyopanishad
Program to generate the pattern:
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
CLS
x = 5
y = 5
a = 1
FOR i = 5 TO 1 STEP -1
p = x
q = y
FOR j = 1 TO i
LOCATE p, q
PRINT a
a = a + 1
p = p + 1
NEXT j
x = x + 1
y = y + 3
PRINT
NEXT i
END
Is there any other logic to solve without the use of locate function??