Sudoku
Moderator: MaxCoderz Staff
huh? how does studying a sudoku solver help? I thought I was just trying to generate one and then write an interface of some sort. Then again, at least it tells me if the generated sudoku will have a unique solution. I duno what I'm going to do about difficulty though. I should probably google "generating sudokus" and see if I can find out more.
-
- New Member
- Posts: 1
- Joined: Tue 03 Jan, 2006 4:14 am
There are a couple problems with writing a Sudoku program. First of all, I don't think you can generate just any Soduku puzzle. I'm pretty sure there are a lot of possible random boards that would be unsolvable. There should be ONLY one spot for every number, whether it is apparent quickly or through a recursive function. The current Sudoku electronic games I've seen just use ones that are programmed in. IF you make such a game, it'd be important to make a testing algorithm to make sure that such a board is solvable.
-
- Calc King
- Posts: 2195
- Joined: Sun 27 Mar, 2005 4:06 am
- Location: sleeping
- Contact:
There has been one made already. Feel free to discuss it here.
Yeah, what you say about randomly generating boards would be quite difficult, unless one generates a board then checks for a solution and if it isn't possible make changes to it, which would make it work.Nick the Wizard wrote:There are a couple problems with writing a Sudoku program. First of all, I don't think you can generate just any Soduku puzzle. I'm pretty sure there are a lot of possible random boards that would be unsolvable. There should be ONLY one spot for every number, whether it is apparent quickly or through a recursive function. The current Sudoku electronic games I've seen just use ones that are programmed in. IF you make such a game, it'd be important to make a testing algorithm to make sure that such a board is solvable.
You could take a solved board and use random algoritms to switch rows and columns and rotate the board to make new solvable puzzles. The only issue is which numbers you can take out. Take out too many, it's impossibly annoying. Take out too few, it's way too easy. Like 3FG said, a sudoku game has already been made.
Well it seems like it would work as you are saying, the difficulty setting would decide if it changes how many sections. I think this topic is about making randomizing boards now .calcul831415 wrote:You could take a solved board and use random algoritms to switch rows and columns and rotate the board to make new solvable puzzles. The only issue is which numbers you can take out. Take out too many, it's impossibly annoying. Take out too few, it's way too easy. Like 3FG said, a sudoku game has already been made.
Well, taking numbers away could make it too easy or completely unsolvable, if you removed them randomly. You would have to check to see if removing a number makes another solution possible, and somehow check to see how "hard" a puzzle is, if that is even possible.
I got a series of sudoku puzzle books for christmas, and started working on a basic program that would solve them. It would basically store all the possible values that could be used in each space, then eliminate the possibilities until you only had one possibility for each space.
I got a few parts of the program done, and it was going pretty well, but I lost interest, and I really have an obligation to learn asm for the n-game project.
If anyone wants the code I got so far(I didn't get all that far, but I almost got to the point of having the first solving algorithm working), let me know and I can upload it. Just so there's no surprises, I'm not very good at optimizing. It's like I have the wrong mindset or something.
I got a series of sudoku puzzle books for christmas, and started working on a basic program that would solve them. It would basically store all the possible values that could be used in each space, then eliminate the possibilities until you only had one possibility for each space.
I got a few parts of the program done, and it was going pretty well, but I lost interest, and I really have an obligation to learn asm for the n-game project.
If anyone wants the code I got so far(I didn't get all that far, but I almost got to the point of having the first solving algorithm working), let me know and I can upload it. Just so there's no surprises, I'm not very good at optimizing. It's like I have the wrong mindset or something.
In Memory of the Maxcoderz Trophy