I'm creating a Sudoku game, and according to the rules of Sudoku, there cannot be the same number in any row or column. My question is this: How do I compare a value with an entire row or column in an array?
For example: I have a 9x9 array that looks like this (a '0' indicates an empty space). Say I place the value '8' in the coordinates 'B2'. How would I check with the entire row '2' and the entire column 'B' to make sure that there isn't a value of '8' already there?
A B C D E F G H I
7 2 3 0 0 0 1 5 9
6 0 0 3 0 2 0 0 8
8 0 0 0 1 0 0 0 2
0 7 0 6 5 4 0 2 0
0 0 4 2 0 7 3 0 0
0 5 0 9 3 1 0 4 0
5 0 0 0 7 0 0 0 3
4 0 0 1 0 3 0 0 6
9 3 2 0 0 0 7 1 4
Much appreciated. :)