[Tutor] Sudoku

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Sep 23 15:56:59 CEST 2012

On 23/09/2012 14:34, myles broomes wrote:
> Me again, I've been sat here for about an hour now staring at this code: # Sudoku
> # Sudoku is a logic-based number-placement puzzle
> # The objective is to fill a 9×9 grid with digits so that each column, each row,
> and each of the nine 3×3 sub-grids that compose the grid contains all of the digits
> from 1 to 9

[code snipped]

> I'm cant figure out how to make it so that each column only has (at most) 1
> of each number. I've managed to do it fine for the rows but I'm not sure of how I can
> do it for the columns. I dont want it to seem like I'm being lazy and just getting you guys
> to do all the work for me so I'm not necceserily asking for a solution, just advice really.  		 	   		

My advice is don't just stare, do something.  Try small pieces of code 
in the interactive interpreter or run the code through a debugger.  FWIW 
I rarely use a debugger but I'd recommend win pdb, which I believe runs 
on all platforms despite the name.


Mark Lawrence.

More information about the Tutor mailing list