Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Some help required, this isn't homework
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?
0 · ·