I am struggling with an algorithm that solves the PE Problem #149. This algorithm, already fully programmed, can be found here.
Within this particular algorithm, I do not understand why the programmer has written code for a diagonal 2 direction and anti-diagonal 2 direction. Is this necessary from a programming point of view? I can't think of any mathematical reason!
Why does it not suffice to look only in the (1) horizontal, (2) vertical, (3) diagonal and (4) anti-diagonal directions?? We are dealing with a nxn matrix (square) in the end...
Let me know your thoughts on this. In the meanwhile I'm waiting for reply from the author.