View previous topic :: View next topic |
Author |
Message |
| roante
| Joined: 07 Feb 2006 | Posts: 2 | : | | Items |
|
Posted: Tue Feb 07, 2006 12:03 pm Post subject: A theory for setting quickly a puzzle |
|
|
Hi all!
I'm newbie here & with Sudoku also (I've never played it yet ), but I wish to make it in Java for my mobile just for fun. At first I thought it'll be an easy work to make a riddle with some interval sets, but for now I've realized that it's much more complex than I thought After I'd another think I got the following theory, and I'm intrested in your opinion about it.
So, first step is to get a matrix of 9x9 with a trivial setting like this:
1 2 3 | 4 5 6 | 7 8 9
4 5 6 | 7 8 9 | 1 2 3
7 8 9 | 1 2 3 | 4 5 6
-----------------------
2 3 4 | 5 6 7 | 8 9 1
..... and so on.
The next step is to multiply it with a random number within the range [1,8] (with modulo 9), then add 1 to it. The result'll be a simple sudoku puzzle I hope (I've learnt about the Zm modulo classes, but I'm not sure if all of the order of the elements are 9 , so hopefully they'll produce the full modulo class of 9 ... I've to check it).
The final step is to multiply the matrix with a random generated transformator matrix (as I know the matrix multiplication is associative). E.g. if I want to reflect the matrix diagonally, I would use a matrix like:
0 ... 0 0 1
0 ... 0 1 0
...
1 0 ... 0
So what do you think? I know it won't produce all of the possible riddles, but I think it can produce more than enough. |
|
Back to top |
|
|
| evert
| Joined: 30 Aug 2005 | Posts: 68 | : | Location: Amsterdam | Items |
|
Posted: Tue Feb 07, 2006 1:06 pm Post subject: |
|
|
Your 2nd step does not work if you choose 3 or 6.
Furthermore the effect of your 2nd step is a permutation of 1-9. Indeed a valid sudoku remains valid after permutation of the digits.
In fact you want to use operations in order to generate all your valid sudoku grids from one particular valid sudoku grid.
However if two grids can be transformed into each other through these operations they are considered to be somehow structurally equivalent.
Generating essentially different grids is sometimes considered more challenging and more fun. |
|
Back to top |
|
|
| roante
| Joined: 07 Feb 2006 | Posts: 2 | : | | Items |
|
Posted: Tue Feb 07, 2006 1:22 pm Post subject: |
|
|
evert wrote: | Your 2nd step does not work if you choose 3 or 6. |
How unfortunate! I haven't spot it...
evert wrote: | Indeed a valid sudoku remains valid after permutation of the digits.
|
Now this is a very valuable information for me, as well as the link you have given!!! Thx a lot, I'm going to get a closer view on them!
evert wrote: |
... However if two grids can be transformed into each other through these operations they are considered to be somehow structurally equivalent.
Generating essentially different grids is sometimes considered more challenging and more fun. |
Now these things are far more complex than I could solve with my puny skill, but I'll try to |
|
Back to top |
|
|
| evert
| Joined: 30 Aug 2005 | Posts: 68 | : | Location: Amsterdam | Items |
|
Posted: Tue Feb 07, 2006 2:18 pm Post subject: |
|
|
roante wrote: | Now these things are far more complex than I could solve with my puny skill, but I'll try to |
Not neccessarily.
On this forum there are many topics about generating grids.
Look around a bit here. |
|
Back to top |
|
|
|