|
View previous topic :: View next topic |
Author |
Message |
| etali
| Joined: 07 Sep 2005 | Posts: 2 | : | | Items |
|
Posted: Wed Sep 07, 2005 11:49 am Post subject: Newbie after some simple tips. |
|
|
Hi all
I'm new to sudoku, and a games programming student. I'm rather rusty with programming (I was ill over the holidays so didn't feel up to putting any practice in) so I mistakenly decided that writing a sudoku game would be a good way to get in programming shape again.
I've started by checking rows and columns to make sure they are valid, and now I'm moving on to checking 3x3 sections. Checking is easy, but generating and solving is driving me nuts.
I figured if I randomised the first row of the grid, then solved from there, then took out most of the squares, that would be the best way to generate a grid, but when I'm solving I keep working myself into a corner with un-solvable patterns, and I'm not sure how to work backwards.
I see theres a lot of source code on this forum, but I'm trying to avoid looking at it because I know there'll be too much temptation to cheat and just use it.
So could anyone give any tips as to the approach they used? Or are there any good, but vague, algorythm hints?
Anything would be appreciated. _________________ --
Etali
http://www.myth-games.com |
|
Back to top |
|
|
| Bo
| Joined: 02 Sep 2005 | Posts: 27 | : | | Items |
|
Posted: Wed Sep 07, 2005 1:19 pm Post subject: Re: Newbie after some simple tips. |
|
|
Hi,
to get a grasp, I think it is easiest to look at the source code of a simple, well commented solver.
One such solver can be found at
http://www.users.waitrose.com/~nihilist/sudoku.html.
I do not think it is the ultimate solver, but I learned quite a lot from it.
Regards,
Bo |
|
Back to top |
|
|
| etali
| Joined: 07 Sep 2005 | Posts: 2 | : | | Items |
|
Posted: Wed Sep 07, 2005 4:35 pm Post subject: |
|
|
Aha! I'm not clear headed enough to read that properly at the moment, but I skimmed it and you are right, that is very well commented and explained
Thanks for that.
I'll study it properly after I've got a few more coffees in me.
(and hey, if it isn't perfect, at least I can try to improve it once I understand it) _________________ --
Etali
http://www.myth-games.com |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
Igloo Theme Version 1.0 :: Created By: Andrew Charron
|