View previous topic :: View next topic |
Author |
Message |
| mister
| Joined: 23 Jul 2005 | Posts: 4 | : | | Items |
|
Posted: Fri Feb 24, 2006 10:48 pm Post subject: Samurai Sudoku Generation |
|
|
I have recently discovered Samurai Sudoku and became addicted.
I was wondering if there is a way you could write a program to assist in the creation of a samurai sudoku puzzle. If you could say the bottom right block must be..., etc. Understand what I am trying to say? I really would like to be able to make samurai sudoku puzzles and put them on my site. Thanks for all the help. |
|
Back to top |
|
|
| evert
| Joined: 30 Aug 2005 | Posts: 68 | : | Location: Amsterdam | Items |
|
Posted: Fri Mar 03, 2006 6:56 pm Post subject: |
|
|
If I may suppose you already built some code for a classic 9X9 grid?
A solver for samurai sudoku should iteratively
-apply classic Sudoku logic in each individual 9X9 grid, and
-exchange candidate exclusions in the overlapping parts
And the process of generating puzzles is not different from classic sudoku : place some random numbers and test the result with the solver. |
|
Back to top |
|
|
| garthd
| Joined: 29 Apr 2006 | Posts: 32 | : | | Items |
|
Posted: Sat Apr 29, 2006 6:01 am Post subject: Re: Samurai Sudoku Generation |
|
|
Can and has been done - i've got some vba code in Excel that does this...let me know if you'd like a copy
mister wrote: | I have recently discovered Samurai Sudoku and became addicted.
I was wondering if there is a way you could write a program to assist in the creation of a samurai sudoku puzzle. If you could say the bottom right block must be..., etc. Understand what I am trying to say? I really would like to be able to make samurai sudoku puzzles and put them on my site. Thanks for all the help. |
|
|
Back to top |
|
|
| The Ostrich
| Joined: 20 Apr 2006 | Posts: 49 | : | | Items |
|
Posted: Sat Apr 29, 2006 10:40 pm Post subject: |
|
|
Yep, its not hard. I'm going to be moving my program over to Samurai capability at some point in the next two weeks. Killer has me a *lot* more worried. |
|
Back to top |
|
|
| m_b_metcalf
| Joined: 13 Mar 2006 | Posts: 210 | : | Location: Berlin | Items |
|
Posted: Sun Apr 30, 2006 2:50 pm Post subject: Re: Samurai Sudoku Generation |
|
|
Quote: | I have recently discovered Samurai Sudoku and became addicted.
I was wondering if there is a way you could write a program to assist in the creation of a samurai sudoku puzzle. If you could say the bottom right block must be..., etc. Understand what I am trying to say? I really would like to be able to make samurai sudoku puzzles and put them on my site. Thanks for all the help. |
If your program is set up to handle just one puzzle at a time, here's a recipe you can try:
Recipe for a butterfly:
1) create a middle grid with your generator;
2) use the 4 ears in turn to generate 4 more grids by solving the appropriate corner box (taking any of the multiple-solutions);
3) make a unique puzzle from the middle grid;
4) make unique puzzles from the other 4 grids, in each overlapping corner box forcing acceptance of only the givens already in the middle grid;
5) In turn, remove 1 clue from each corner and check each ear solution becomes multiple (remove 2 or more if necessary). Do middle last.
6) To ensure whole has unique solution, solve by hand to point where all removed corner cells have been restored.
HTH
Mike Metcalf |
|
Back to top |
|
|
| The Ostrich
| Joined: 20 Apr 2006 | Posts: 49 | : | | Items |
|
Posted: Wed May 03, 2006 1:46 am Post subject: |
|
|
Its also quite easy to set up dancing links to handle Samurai. I would tend to assume that most valid Samurai will have multiple solutions for all grids if they're minimal, so an easier way than the above would be to
1) Set up dancing links for a Samurai grid (this is basically exactly the same set-up as for regular sudoku, except that there are more cells (and therefore more rows), and that each cell in a corner box will have 1s in 6 columns instead of 4.
2) Generate a random minimal Samurai using exactly the same generation algorithm as your regular one.
3) Test the whole thing for difficulty using your modified logic solver (do as much as possible on each grid in turn, until the puzzle is solved, or no progress can be made - basically, with about 50 lines of extra code to pick givens out of the Samurai puzzle and place them in the regular arrangement, you can use your unmodified 9x9 solver.
4) Test the component puzzles for multiple solutions using the regular 9x9 DLX. |
|
Back to top |
|
|
| milford833
| Joined: 27 Jan 2010 | Posts: 1 | : | | Items |
|
Posted: Wed Jan 27, 2010 7:33 am Post subject: Re: Samurai Sudoku Generation |
|
|
garthd wrote: | Can and has been done - i've got some vba code in Excel that does this...let me know if you'd like a copy
mister wrote: | I have recently discovered Samurai Sudoku and became addicted.
I was wondering if there is a way you could write a program to assist in the creation of a samurai sudoku puzzle. If you could say the bottom right block must be..., etc. Understand what I am trying to say? I really would like to be able to make samurai sudoku puzzles and put them on my site. Thanks for all the help. |
|
I would like the code for that if you still have it around. Thank you. |
|
Back to top |
|
|
|