Sudoku Programmers Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in          Games  Calendar

Log in to check your private messagesLog in to check your private messages   

Sudoku Generator

 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Setting sudoku
View previous topic :: View next topic  
Author Message
Xenos

Joined: 03 Jan 2006
Posts: 2
:

Items
PostPosted: Tue Jan 03, 2006 6:26 pm    Post subject: Sudoku Generator Reply with quote

Hi everybody,

for a school project I am working on a sudoku generator. In my mind I had a step plan for writing this program:

- Program solver functionality ( Finished )
- Program a function that can create random sudoku solutions( you call them grids right?) ( Problem )
- Program a function that takes this random solution, removes random numbers and checks if the sudoku is still solveable. ( Not started yet )

I have tried to finish that second step, just by looping through a 81 number integer until it forms a sudoku solution, but this takes way to long.

Is there an easier way? I want a sudoku to appear within seconds, is this possible?

Please help me out,

David
Back to top
View user's profile Send private message
Ikzann

Joined: 03 Jan 2006
Posts: 5
:

Items
PostPosted: Sun Jan 08, 2006 4:02 pm    Post subject: Reply with quote

You probably want to use DLX. This can generate sudokus within 20-200 miliseconds, usually. You'll have to do some research, though. I don't know how to do it well enough to explain it to you.
Back to top
View user's profile Send private message
Xenos

Joined: 03 Jan 2006
Posts: 2
:

Items
PostPosted: Sun Jan 08, 2006 9:47 pm    Post subject: Reply with quote

Hi,

thanks for replying. However, I have already finished my sudoku generator now. I don't know what DLX means, but what my grid generator basically does is fill in numbers in the spaces with the least amount of possibilities untill the solver can solve it, and make a full grid out of it. If filling in a certain number makes the sudoku unsolvable, the program empties the grid, and the proces is restarted. This creates full grids pretty fast. I am sure that there are more efficient ways to do it, but this one works absoluty fine for my purposes!

Greetings,

David

P.S: I could have gotten the answer to my question by looking at other posts. I mean, everyone basically asks the same questions here Razz
Back to top
View user's profile Send private message
eclark

Joined: 28 Dec 2005
Posts: 70
:

Items
PostPosted: Mon Jan 09, 2006 2:20 am    Post subject: Reply with quote

You may want to just try removing that last placed number rather than a full restart. That yeilds faster results
Back to top
View user's profile Send private message
shirley

Joined: 21 Jul 2006
Posts: 1
:

Items
PostPosted: Fri Jul 21, 2006 4:36 pm    Post subject: Reply with quote

eclark wrote:
You may want to just try removing that last placed number rather than a full restart. That yeilds faster results

Hi,
I am just a junior student. I am interested in Sudoku, I would like to know how you can build up the Sudoku solver and then use it to build up the whole Sudoku program?

Would you like to share the ideas with me?
Back to top
View user's profile Send private message
Papy

Joined: 14 Jul 2006
Posts: 12
:

Items
PostPosted: Tue Aug 15, 2006 11:43 am    Post subject: Generator Reply with quote

Shirley

If you used specific Brute force you can have an 'reversible' alogo used to generate and solve grids
All the grids are equal each one can accept 17,20,25... reveled. Is't a caracteristique of the Latin Square

So if you generate a latin square , then remove numbers and run again the generator you can find the original square

If you genrate

123
456
789

you remove numbers to get
..3
4..
..9

if you run the generator you found
the solution BUT NOT ONLY
for example
213
465
879

The challenge is to determine the numbers to remove(how many and which)

Sorry for my poor English: I'm french.

I'm looking for the technique to detremine if a grid has only one solution?
Is some one can help me?
I'm laso looking after Grid Collection (NOT IN PDF)
Thanks

Jérôme
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Setting sudoku All times are GMT
Page 1 of 1

 
Jump to:  
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
Sudoku Programmers topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

Igloo Theme Version 1.0 :: Created By: Andrew Charron