2-dimensional data structures

Carl J. Van Arsdall cvanarsdall at mvista.com
Thu Jan 26 22:18:36 CET 2006


anthonyberet wrote:
> Hello again - rather a newbie here...
>
> I want to work on a sudoku brute-forcer, just for fun.
>
> I am considering different strategies, but first I need to decide on the 
> data-structure to use for the progress/solution grid.
>
> This being a square, I would have used a 9x9 2-dimensional array in my 
> teenage years back in the 80's, using BASIC.
>
> What is the equivalent way to store data in python? - It isn't obvious 
> to me how to do it with lists.]
>   
Well, you could do a list of lists, or a tuple of tuples, or a 
combination thereof.

For example:
val = matrix[indexA][indexB]

-carl
> 'scuse me for being thick - but give me a little pointer and I will do 
> the rest.
>   


-- 

Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software




More information about the Python-list mailing list