im doing a program for sudoku solver.. below is the code i found from a website..
I dont understand y mark[10] and not mark[9]?
and the mark[matrix[x][i]] means?
thanks~
The numbers stored in each box is from 1-9. They use these numbers as index to the mark array so instead of having to subtract one from the number each time, they made the array one bigger and never use mark[0] for anything.
EDIT:
Maybe they use the number 0 to represent that no number has been placed at that position. If that is the case this approach also avoids the need to check if the number is 0 because it will just set mark[0], which doesn't matter because the value of mark[0] will be ignored anyway.
Just to demonstrate, if mark was made size 9, instead of doing mark[matrix[x][y]] = false; you would have to do