Algorithm for figuring out which anti-diagonal you are in based on row and column of a chess board?

Viewed 21

I have a chess board with the standard layout, where the columns range from 1-8 (left to right). And the rows range from 1-8 (up to down). For the regular diagonals, I figured out which diagonal you are in by the formula ((col + row) - 1). However, for the anti-diagonals, I have no idea how to come up with an algorithm. I cannot rotate the chess board 90 degrees, either.

0 Answers
Related