I am trying to encode a sudoku solution, and the way I tried to do this was to have a 9x9 pointer grid that contains the address of the βinstalledβ objects that have either a solution or valid possible values.
I managed to go through an array with 2 for loops, through each column first, and then move on to the next row and repeat.
However, it is difficult for me to imagine how I will determine which subsegment (or field, block, etc.) belongs to a particular cell. My initial impression was to have if statements in for loops, for example, if line <2 (lines start at 0) and col <2, then we are in block 1, but that seems to be confused. Would there be a better way to do this?
kevin source share