Some help required, this isn't homework - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Some help required, this isn't homework

StaticSnippetStaticSnippet Posts: 3Member
Well I've been working on a Sudoku Solver. I ran into a problem;
This is a typical Sudoku:
http://i166.photobucket.com/albums/u88/Jaker545/gene.jpg
So here's my problem;
In my code, the way I'm doing it is I have 81 instances of a "cell" class, representing one of the possible values on the Sudoku.
However, for a given row ex:
1 2 3 4 5 6 7 8 9
I have an array of cells;
0 1 2 3 4 5 6 7 8 would be my first row
9 10 11 12 13 14 15 16 17would be my second row.

So I need a clever way to add cells to each appropriate "box"
so for box one, the numbers in the box would be 0 1 2 from the first row, 9 10 11 from the second row.
Box two would be 4 5 6 from the first row, and 12 13 14 from the second etc etc
Anyone have any ideas?

Comments

Sign In or Register to comment.