Skip to main content
added 8 characters in body
Source Link
isrnick
  • 748
  • 6
  • 14

As can be seen above, the first antidiagonal begins at the first row and first column (0, 0), and for the following positions, at first only the column coordinate is incremented, and only after reaching the last column (= 5 = n - 1) the row coordinate starts to be incremented instead.

As can be seen above, the first antidiagonal begins at the first row and first column (0, 0), and for the following positions, at first only the column coordinate is incremented, and only after reaching the last column (= 5 = n - 1) the row coordinate starts to be incremented.

As can be seen above, the first antidiagonal begins at the first row and first column (0, 0), and for the following positions, at first only the column coordinate is incremented, and only after reaching the last column (= 5 = n - 1) the row coordinate starts to be incremented instead.

added 4 characters in body
Source Link
isrnick
  • 748
  • 6
  • 14

It can be seen that, given a pair of coordinates row, column somewhere in the middle of the grid, the coordinates of next position along its antidiagonal will be in the next row (going down), and in the previous column (to the left) of the grid, i.e. the next position will have coordinates row + 1, column - 1.

It can be seen that, given a pair of coordinates row, column somewhere in middle of the grid, the coordinates of next position along its antidiagonal will be in the next row (going down), and in the previous column (to the left) of the grid, i.e. the next position will have coordinates row + 1, column - 1.

It can be seen that, given a pair of coordinates row, column somewhere in the middle of the grid, the coordinates of next position along its antidiagonal will be in the next row (going down), and in the previous column (to the left) of the grid, i.e. the next position will have coordinates row + 1, column - 1.

added 5 characters in body
Source Link
isrnick
  • 748
  • 6
  • 14

In conclusion, the entire logic for the coordinates ofto traverse the grid through its antidiagonals can be written as:

In conclusion, the entire logic for the coordinates of the antidiagonals can be written as:

In conclusion, the entire logic to traverse the grid through its antidiagonals can be written as:

Source Link
isrnick
  • 748
  • 6
  • 14
Loading