One of the first challenges in this type of program is how were are going to represent the board in code.
The board is a grid of 9 columns by 9 rows and each intersection forms a cell.
A cell will contain either,
- A number for a known cell
- A blank or a space
- A range of numbers 1 – 9 of possible values that may be in the cell.
This looks like a 2 dimensional array where we use x,y coordinates to specify a cell. The cell can then contain a list of possible values.
Python uses list for arrays and a list of lists for 2 D arrays. So lets get our mind around that concept 🙂
Cab you now do this to simulate the full Sudoku Board of 9 x 9 grid ?
NOTE – Do not use the grid in the video above as a starting point. It is just for illustration and does not have a solution. (Thanks to Gillian Ward for spotting that one 🙂 )