Let's have a variable
r
that counts the rows, starting from zero, so that
at first row r = 0
at second row r = 1
...
Now let's have another variable
c
that contains the column of the
'*'
, so that
at 1st row r = 0, c = 0
at 2nd row r = 1, c = 1
at 3rd row r = 2, c = 2
at 4th row r = 3, c = 1
at 5th row r = 4, c = 0
at 6th row r = 5, c = 1
at 7th row r = 6, c = 2
...
Do you spot the pattern ? :-D
Is there a relation between the value of
r
and the one of
c
?