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   

Generating Sudoku puzzles via Mathematica

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

Joined: 20 Dec 2005
Posts: 1
:

Items
PostPosted: Tue Dec 20, 2005 12:59 am    Post subject: Generating Sudoku puzzles via Mathematica Reply with quote

Does anyone have any programming experience with Mathematica?
If so, do you know how I would generate Sudoku puzzles using this language?
Initially, my algorithm goes to a random cell and adds a random number, from 1 to 9, in this cell.
After this is done, my algorithm goes to a random and empty cell and adds a legal number in this cell - this process should be repeated a certain number of times, but determining the number of times can be tricky.
When a puzzle is generated from this algorithm, I find that this puzzle gives a logical contradiction (i.e. two numbers have to go in the same cell).
Is there a better way to generate Sudoku puzzles?
Btw, Mathematica is primarily a functional programming language so any suggestions based on any functional programming language would be much appreciated.
Otherwise, any other suggestions would also be welcomed!
Back to top
View user's profile Send private message
evert

Joined: 30 Aug 2005
Posts: 68
:
Location: Amsterdam

Items
PostPosted: Tue Dec 20, 2005 3:05 pm    Post subject: Reply with quote

Designing the algorithm is not really dependent of the programming language used, is it?
Quote:
Initially, my algorithm goes to a random cell and adds a random number, from 1 to 9, in this cell.
After this is done, my algorithm goes to a random and empty cell and adds a legal number in this cell - this process should be repeated a certain number of times, but determining the number of times can be tricky.
When a puzzle is generated from this algorithm, I find that this puzzle gives a logical contradiction (i.e. two numbers have to go in the same cell).

Repeat this process until a contradiction has been found.
If a contradiction has been found empty your grid and start over again.

THIS process should be repeated until the gris is full without any contradiction.
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 -> Programming 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