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   

Samurai Sudoku Generation

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

Joined: 23 Jul 2005
Posts: 4
:

Items
PostPosted: Fri Feb 24, 2006 10:48 pm    Post subject: Samurai Sudoku Generation Reply with 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.
Back to top
View user's profile Send private message
evert

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

Items
PostPosted: Fri Mar 03, 2006 6:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
garthd

Joined: 29 Apr 2006
Posts: 32
:

Items
PostPosted: Sat Apr 29, 2006 6:01 am    Post subject: Re: Samurai Sudoku Generation Reply with quote

Can and has been done Very Happy - 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
View user's profile Send private message
The Ostrich

Joined: 20 Apr 2006
Posts: 49
:

Items
PostPosted: Sat Apr 29, 2006 10:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
m_b_metcalf

Joined: 13 Mar 2006
Posts: 210
:
Location: Berlin

Items
PostPosted: Sun Apr 30, 2006 2:50 pm    Post subject: Re: Samurai Sudoku Generation Reply with quote

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
View user's profile Send private message
The Ostrich

Joined: 20 Apr 2006
Posts: 49
:

Items
PostPosted: Wed May 03, 2006 1:46 am    Post subject: Reply with quote

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
View user's profile Send private message
milford833

Joined: 27 Jan 2010
Posts: 1
:

Items
PostPosted: Wed Jan 27, 2010 7:33 am    Post subject: Re: Samurai Sudoku Generation Reply with quote

garthd wrote:
Can and has been done Very Happy - 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
View user's profile Send private message
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