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   

java solving

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

Joined: 28 Mar 2006
Posts: 14
:

Items
PostPosted: Tue Apr 18, 2006 4:47 pm    Post subject: java solving Reply with quote

Hi, I have produced a java implementation of a dlx based generator. It produces a sudoku puzzle with a set number of clues, however, the puzzle may or may not be solvable. This is because I have not integrated a solving engine into the generator code that will run after the entry of each new clue to check that clue is valid.

At the moment I just cannot get my head around the solving.

My generator has an array called: dlxGrid[81][9].

where dlxGrid[number of cells in a grid][all possible digits that can go in cell].

I have a random number generator that generates 2 numbers 1 between 0-80 and one between 0-9. this gives me a placement from my array dlxGrid. i then transpose this to my sudokuGrid[81] and zero the corresponding values in dlxGrid[][] (this stops me from selecting any number that would conflict).

As you can hopefully see this allows me to produce a sudoku grid with clues which do not conflict with each other, but could produce an unsolvable puzzle.

i'm guessing my solver would be similar to my generator but with back tracking just incaase it cannot be solved.

Can anyone like Ruud simplify the process of solving like he did for generating here:http://www.setbb.com/sudoku/viewtopic.php?p=1811&mforum=sudoku#1811

as i found this very useful and managed to code it in a day. (i think anyway!)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Solving 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