Re: 2-dimensional data structures

2006-02-19 Thread Gerard Flanagan
anthonyberet wrote: > I want to work on a sudoku brute-forcer, just for fun. >... > Thanks for the advice (to everyone in the thread). > I think I will go with nested lists. > However, I am running into a conceptual problem. > My approach will be firstly to remove all the impossible digits for a >

Re: 2-dimensional data structures

2006-02-18 Thread Kirk McDonald
anthonyberet wrote: > Thanks for the advice (to everyone in the thread). > I think I will go with nested lists. > However, I am running into a conceptual problem. > My approach will be firstly to remove all the impossible digits for a > square by searching the row and column for other occurances.

Re: 2-dimensional data structures

2006-02-18 Thread [EMAIL PROTECTED]
anthonyberet wrote: > Tim Chase wrote: > >> I want to work on a sudoku brute-forcer, just for fun. > > > > > > Well, as everybody seems to be doing these (self included...), the > > sudoku solver may become the "hello world" of the new world :) > > > >> What is the equivalent way to store data in

Re: 2-dimensional data structures

2006-02-18 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: > The question is not so much which region a give square is in, but more > which square contains which fields. If we assume that you number your > squares row-wise (top-left zero, top-right 3, bottom-right 9), this > function computes the field indices that a given squa

Re: 2-dimensional data structures

2006-02-18 Thread Diez B. Roggisch
> However, I wondering how to approach the search of the nine regions of > the grid. I am thinking of producing another nested list, again 9x9 to > store the contents of each region, and to update this after each pass > through -and update of- the main grid (row and column). > > I am not sure h

Re: 2-dimensional data structures

2006-02-18 Thread Kermit Rose
    From: anthonyberet Date: 02/18/06 17:11:01 To: python-list@python.org Subject: Re: 2-dimensional data structures     I am not sure how to most efficiently identify which region any given square on the grid is actually in - any thoughts, for those that have done this? - I don't w

Re: 2-dimensional data structures

2006-02-18 Thread anthonyberet
Tim Chase wrote: >> I want to work on a sudoku brute-forcer, just for fun. > > > Well, as everybody seems to be doing these (self included...), the > sudoku solver may become the "hello world" of the new world :) > >> What is the equivalent way to store data in python? - It isn't obvious >> to

Re: 2-dimensional data structures

2006-01-27 Thread Grant Edwards
On 2006-01-26, Larry Bates <[EMAIL PROTECTED]> wrote: >> 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 9

Re: 2-dimensional data structures

2006-01-27 Thread Scott David Daniels
Claudio Grondi wrote: > anthonyberet wrote: >> Hello again - rather a newbie here... >> I am considering different strategies, but first I need to decide on >> the data-structure to use for the progress/solution grid. > > ... define your grid as a dictionary in a following way: > grid = {} > for

Re: 2-dimensional data structures

2006-01-27 Thread Max
Claudio Grondi wrote: > > Another approach as already proposed could be, that you define your grid > as a dictionary in a following way: > grid = {} > for column in range(1,10): > for row in range(1,10): > grid[(column, row)] = None > # then you can refer to the cells of the 'array' like: >

Re: 2-dimensional data structures

2006-01-26 Thread Claudio Grondi
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

Re: 2-dimensional data structures

2006-01-26 Thread Tim Chase
> I want to work on a sudoku brute-forcer, just for fun. Well, as everybody seems to be doing these (self included...), the sudoku solver may become the "hello world" of the new world :) > What is the equivalent way to store data in python? - It isn't obvious > to me how to do it with lists. S

Re: 2-dimensional data structures

2006-01-26 Thread Larry Bates
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

Re: 2-dimensional data structures

2006-01-26 Thread Carl Cerecke
anthonyberet wrote: > Hello again - rather a newbie here... > > I want to work on a sudoku brute-forcer, just for fun. I know what you mean. I wrote one just for fun too. > I am considering different strategies, but first I need to decide on the > data-structure to use for the progress/solution

Re: 2-dimensional data structures

2006-01-26 Thread Carl J. Van Arsdall
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 9

2-dimensional data structures

2006-01-26 Thread anthonyberet
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 tee