View previous topic :: View next topic |
Author |
Message |
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Wed Jul 02, 2008 7:24 pm Post subject: Need 4x4 sudoku |
|
|
Could someone generate some easy 4x4 sudoku for me.
I think my solver has an error in it.
To be sure I'd need about 15 and they must be easy sudoku, the techniques my solver uses are:
Hidden and naked singles
Pointing
Claiming
Naked Pairs
Xwing
And please could they be in an easy format that i can just copy into my program.
Thanks
Mark |
|
Back to top |
|
|
| wapati
| Joined: 12 Jun 2007 | Posts: 622 | : | Location: Canada | Items |
|
Posted: Wed Jul 02, 2008 8:22 pm Post subject: Re: Need 4x4 sudoku |
|
|
mrmarky2 wrote: |
And please could they be in an easy format that i can just copy into my program.
|
And how would we know what is easy to paste into your program?
....3..1ec6g.....8fe........2.7..5...g.df.13.....b.....4.....9.13....6...g.a.7.b..1.edb3...9.........1.....d8fc5f.g7.9.....b...3a.c.........18f92...g....6f1....d.8......9b..2.76.9.b2fe.7.......4....d.3...f.98...6a.g.9.5...d..g....9.a...c4.....56.4bc.7.a...
3.....e.....5d4fb...c6.f.3d.....c..7....1498e...9.e.2.8......3....a..86.9.4.g.5..bd.e...27.f..c..c6..5.....g9..b..1.f7.c5.....2..4.....gc.87.e..5..c7.....1..9b..d..8.53...b.27..2.b.1.d.53..a....2......6.5.7.d...6gfc4....a..1.....23.g.a1...4a7c8.....e.....g
a.2.7.6...fd..9.3.76..2.....f..4....d.ba4e93....1.c...f...8.3.a..e.....f.3...9.5...3.6..d...ba.2.6.2...7f..e.3..9..d.c.4.7b..g....f.19..cb.6.7....e9........gd18....6a.29.5.....c.3..4.5.....2.9......5.a4e...6..4..f.ge....d.8be86......g.5.....c..2...7...a.3f
2.3e8.f.c....7........b.9.4..e..d..76.......5fac6.9.c...87.5.b..8.g6.c.7....e.......9.6154d...c.53...e..f.2.9.......a2...9e.8.379c.4.8e...5b.......5.7.3..f...be.1...49c6g.d.......d....e.c.42.5..c.1.5f...2.3.b4673.......cf..a..b..6.9.5........5....d.1.egc.4
.....3.4b.98.....7.9........8agb....7d.9..ac.....5......6...9.3e..d..4..26.5.e..7.e.g.3.a...6.c......a6.....3f9g8.g.....3e.1..7.d..gcf.e.....2......8..3.152.c.95.1......3...8.6c.8.5..d.g.9...4.6.d.57.......ea.a..4.c.5f7......1.8.eg6....b.4..g.7..f..bdec...
...dbg.27....5..9.4b....f8.1.7......e1.d....g.8f6..7.9..5.dc.3....5.8.d...6.9.1..1g.....29c8e...7c2.f.....e...b...9.c..4..5.6.g2.....8b.6....d.9b..3.d.5...4....2.....ge....f4.b8.......3b.g.1.6.2....a.....8.d1.4f.....8ga3..6..381.....d7.........dfc..1..4.7.
.c..dgb.3..9.1.62f.g..8......349....f...52g8.e...7.a4...e......8e.78.d...4.f..3.f...7.61.......bc4...b...6.a..5......5...c.31.9f3.gc......6.e.2...e.c.fd..a.g.1...5.....1d.cf.6.a.4.1.e2..b.9..........c279g.5..gac.........4..d.6..3.94ae5.....9e.7.f.5.....6.1
g2...ad..7....b.a.......e..59g.3....f.3.gc.2..d.1..c..4..b..6.2...9.e3.d.....2g.6.d2...g4f7..........f.2..c.8d.98.1.....3.d..64...b.2c.e.a67......7f........bc.d..4.5..a.3.1...6..3.84.f...c.7...4.5..f...8.a....8..32e61.bf....f763...........e.e......2.3.c.58
.5.e.2.a...g...84..2...f.d.eb..6.......g.c.b3..4d7.1.4.c.f..9..e.....b...g32..9.3..b9.e2.....c.......d..5bf9.7.35974.3.......2........4..6e7g..1.269a.5.8...........c.g.9...ef.5eca.f.d.g...8....846....b.cd..5......c2e..7..6d.....b.......4e879ge7..3.4.5...1.
e.8.d.fc.b...5..b.6.....2ea4....g...4..e....62.14.9...82.f...7...c...8..9..a..d..d.e.b6a.5....8..6.2....c.1.9.54...b.591.d.f..a......a.b6.d.c9.33f......a.e.8..d.4..e3.9f.c5....cg.6.d.......4.e....a...d16.....db7.........e.c5..c.34e..ag8......1.9.c.....af78
a.......4.6c..d...7.gad1.....9.25.93......2..1f.g.d.6.9.f..3.....3...6.5..f.9..4.g.e....7..6.d.1fab6.8.3............7.ad..c.b..g8d......c6.5..9..f..9.2.1...e.g.2e..f....4.d..7..c..bd6.e...5.3.e.21.....c4..7.....9.....d..ae8.....dg4e.a82.......c.b.6.f..4g.5
e.ca.2...f..8.......dcg.84.b....5.7......ge.3.a.d...1e........6b.8.7.6..a....5.e25.18.a.9....g...f...15d6..g.2........2.1.5.68.a.7..c812..9.....ac9..........bd7..g....34.7c.....1....b...d.faec9.d....8...2..7f....a79f.8.d......eg.....a.9d.b8...b4..5.6.e2.1.
.g.51b8f.....7...2....d.6gf5.....1..2..e....9..c.7.a..g.b.e2.6..a.8g.c...9..e.b.4....g7.....1.c.5.b2....1d.4..f.....d3..cf..4.a.68d1.........a.g....fe6...2.8.51b.7...1.8.5g...3...f..a.3....4.b....8..a.2.f7..57f...1.4.3.8....2.c....5....b186.4a..d.b.561....
5..c9......27..d...b.e.7g.8.a...28.f...a1...b.e4....2.dgcb.a.....9b..61..eg..8d.1d.7........f.c5....d9....f1......e..a8..26..9....g..c6..3e..7......34....7b....47.a........2.98.f8..2g..1c..64.....e.534c.6....e2.4...63...g.fc...6.7.d9.2.3...c..g4......d9..1
76df.......4..1.....g....2..bd.45...b.d..c...a8.9.a.e.c..d.1..f....7...b..8.6..2.f...g.d.1c2...........7.9g.54e.4d53c2..........c........7ag......3.4.f.....18..6be9....c.3.......4.9.8.5...gb2.f8...d..1..3...c....3b6.f...4..g.5.6.7..a.9....d...d.c.g8...fe.a
|
|
Back to top |
|
|
| m_b_metcalf
| Joined: 13 Mar 2006 | Posts: 210 | : | Location: Berlin | Items |
|
Posted: Thu Jul 03, 2008 7:44 am Post subject: |
|
|
Here are three in a completely different format. Let us know what your definition of 'easy format' is.
Code: |
. . . . . . 8 . . 9 . . . . . .
. . . 5 . 9 . . . . 3 . 6 . . .
. . 7 11 . 2 . 10 5 . 13 . 12 9 . .
. 8 14 . 5 . 4 . . 16 . 15 . 1 13 .
. 11 . 6 . . 16 15 10 13 . . 1 . 7 .
. . 13 . 8 . . 4 6 . . 12 . 10 . .
10 . 4 7 13 . . . . . . 16 9 2 . 8
12 . . 16 10 7 . . . . 14 9 15 . . 6
13 . . 15 16 12 . . . . 6 8 14 . . 5
14 . 3 12 7 . . . . . . 4 11 15 . 9
. . 11 . 1 . . 2 3 . . 7 . 16 . .
. 1 . 8 . . 5 14 15 2 . . 10 . 12 .
. 14 9 . 11 . 10 . . 6 . 1 . 7 5 .
. . 10 3 . 1 . 16 13 . 15 . 2 8 . .
. . . 1 . 15 . . . . 8 . 3 . . .
. . . . . . 13 . . 11 . . . . . .
. . . 9 . . . 13 4 . . . 16 . . .
. . 12 . . . 10 . . 1 . . . 6 . .
. 14 . . 15 . 6 4 11 12 . 10 . . 2 .
8 5 . . . . . 7 16 . . . . . 14 3
. . 14 10 . 2 . 15 6 . 13 . 7 3 . .
. . . . . 4 16 10 2 11 9 . . . . .
1 11 6 . . . 13 9 7 3 . . . 2 16 12
. 2 16 4 . . 1 . . 14 . . 6 8 11 .
. 13 4 5 . . 3 . . 2 . . 9 14 8 .
15 16 11 . . . 7 14 5 13 . . . 1 12 10
. . . . . 15 9 11 1 4 12 . . . . .
. . 1 14 . 5 . 2 3 . 11 . 4 15 . .
5 6 . . . . . 8 13 . . . . . 9 7
. 3 . . 5 . 14 16 8 6 . 2 . . 1 .
. . 9 . . . 15 . . 5 . . . 10 . .
. . . 7 . . . 6 9 . . . 2 . . .
. . . . . . . . . . . . . . . .
. . 15 . . . 6 16 10 3 . . . 7 . .
. 13 . 14 11 12 . 7 4 . 8 2 5 . 10 .
10 . 2 . . 15 . 13 5 . 6 . . 14 . 9
16 12 . . . 8 . 6 14 . 3 . . . 9 5
. 5 . . . 1 14 9 16 4 2 . . . 12 .
4 2 1 . . . 3 . . 13 . . . 10 14 6
. 14 . 9 . 11 10 . . 5 12 . 4 . 13 .
. 4 . 13 . 10 5 . . 1 16 . 15 . 6 .
11 8 3 . . . 7 . . 6 . . . 13 5 16
. 10 . . . 3 12 8 7 14 13 . . . 2 .
9 6 . . . 13 . 1 2 . 5 . . . 3 7
14 . 10 . . 5 . 12 3 . 4 . . 2 . 13
. 9 . 3 16 7 . 10 12 . 11 6 14 . 15 .
. . 16 . . . 15 14 13 7 . . . 1 . .
. . . . . . . . . . . . . . . .
|
Regards,
Mike Metcalf |
|
Back to top |
|
|
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Thu Jul 03, 2008 3:17 pm Post subject: |
|
|
Wapati thanks
Quote: | And how would we know what is easy to paste into your program? |
Dunno why I put this, because an easy form is just about anything for me.
Thanks for the puzzles both of you.
Mark |
|
Back to top |
|
|
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Thu Jul 03, 2008 3:27 pm Post subject: |
|
|
Yup my solver is mucked up.
I loaded it up and press solve, it then messes up.
I'll have to look and see what technique isn't working
Mark |
|
Back to top |
|
|
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Thu Jul 03, 2008 5:11 pm Post subject: |
|
|
Thanks I found the source of the problem
1 letter out of place. A 1 instead of a j!
Now it seems to solve the puzzles, i'll check on the rest first.
Thanks
Mark |
|
Back to top |
|
|
| m_b_metcalf
| Joined: 13 Mar 2006 | Posts: 210 | : | Location: Berlin | Items |
|
Posted: Thu Jul 03, 2008 6:06 pm Post subject: |
|
|
mrmarky2 wrote: |
Thanks for the puzzles both of you.
|
You're welcome. I can provide you with samples up to 12x12 (but not 9x9 or 11x11). Some large puzzles can be found on the Sudoku Variants thread on the Sudoku Players' Forum.
Regards,
Mike Metcalf |
|
Back to top |
|
|
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Thu Jul 03, 2008 6:14 pm Post subject: |
|
|
Thanks
Im not going up that high. But i'll be doing 5x5. I have made my solver a class so very little change and it can use 5x5. I was using menneske.no but it takes a lifetime to click in over 100 numbers every puzzle. It will be even worse with the 5x5.
Mark |
|
Back to top |
|
|
| m_b_metcalf
| Joined: 13 Mar 2006 | Posts: 210 | : | Location: Berlin | Items |
|
Posted: Fri Jul 04, 2008 8:11 am Post subject: |
|
|
mrmarky2 wrote: | Thanks
Im not going up that high. But i'll be doing 5x5. I have made my solver a class so very little change and it can use 5x5. I was using menneske.no but it takes a lifetime to click in over 100 numbers every puzzle. It will be even worse with the 5x5.
|
Sounds as though you need a different input mechanism. Meanwhile, here's Code: |
. . . . . . . . . . . . 17 . . . . . . . . . . . .
. . 12 . . . . . 13 . . . 5 . . . 14 . . . . . 7 . .
. . . . . . . 20 . 7 10 4 . 18 11 6 . 12 . . . . . . .
. 9 . 1 . 18 . 21 . 8 7 12 19 13 6 20 . 5 . 23 . 17 . 3 .
. 14 4 . 7 23 25 12 1 11 . . 22 . . 16 2 10 15 17 21 . 6 19 .
22 . . . . 14 24 . . . . . . . . . . . 13 25 . . . . 20
17 25 5 . 13 . . 10 . . . 11 20 7 . . . 2 . . 23 . 15 9 22
. . 15 11 . 25 2 . 3 . 21 13 . 22 19 . 8 . 23 5 . 6 1 . .
. 1 9 . 12 15 . . . 13 3 5 . 6 8 22 . . . 10 7 . 19 14 .
23 6 3 . . . 20 . 4 9 16 25 24 17 10 15 19 . 1 . . . 8 11 18
15 . . 16 23 . 21 9 22 12 . 10 . 14 . 13 17 8 5 . 24 18 . . 19
20 . 19 3 . . . 14 5 24 . . 7 . . 1 25 22 . . . 23 17 . 9
. 7 . 13 10 20 15 . . 25 . . . . . 4 . . 18 19 3 1 . 21 .
1 . 17 14 . . . 8 2 10 . . 6 . . 23 20 21 . . . 16 12 . 25
24 . . 9 6 . 13 1 19 3 . 18 . 25 . 10 11 16 14 . 15 22 . . 4
3 10 21 . . . 23 . 20 14 13 15 12 24 7 19 16 . 11 . . . 4 17 6
. 2 7 . 17 5 . . . 19 9 14 . 23 22 24 . . . 12 20 . 11 18 .
. . 14 20 . 1 17 . 16 . 8 6 . 4 18 . 7 . 3 2 . 10 24 . .
4 24 23 . 1 . . 11 . . . 21 16 20 . . . 6 . . 5 . 9 15 12
8 . . . . 3 22 . . . . . . . . . . . 10 20 . . . . 16
. 17 2 . 21 13 3 6 8 15 . . 11 . . 25 9 4 19 24 18 . 23 5 .
. 4 . 7 . 2 . 25 . 17 5 20 14 9 21 3 . 15 . 18 . 19 . 6 .
. . . . . . . 19 . 23 17 24 . 10 4 7 . 20 . . . . . . .
. . 24 . . . . . 9 . . . 2 . . . 21 . . . . . 25 . .
. . . . . . . . . . . . 15 . . . . . . . . . . . . |
Best of luck,
Mike Metcalf |
|
Back to top |
|
|
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Fri Jul 04, 2008 10:40 am Post subject: |
|
|
m_b_metcalf wrote: |
Sounds as though you need a different input mechanism. Meanwhile, here's |
Well there are 2 ways of doing it, i can open a file that has 16 lines of 16. Or I can click them in manually.
If im using menneske.no i have to click them in manually.
I dont quite need 5x5's yet but when I do that format is very good for my program.
I'll test that one later
And btw, my solver couldn't solve the last 4x4 puzzles you gave me, what techniques are in it?
Thanks
Mark |
|
Back to top |
|
|
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Fri Jul 04, 2008 4:37 pm Post subject: |
|
|
I think I spoke too soon.
I've finished the 4x4 program, and started a 5x5 program.
The 5x5 puzzle you gave me is too difficult for my solver to solve.
It can only solve:
Hidden and naked singles
Pointing
Claiming
Naked Pairs
Xwing
Not many, but I think this is the hardest puzzle I'd like to solve.
Please could I have some more 5x5 puzzles? As a long string, or like the ones you did before?
How long does it take to generate one?
Thanks
Mark |
|
Back to top |
|
|
| m_b_metcalf
| Joined: 13 Mar 2006 | Posts: 210 | : | Location: Berlin | Items |
|
Posted: Fri Jul 04, 2008 7:54 pm Post subject: |
|
|
mrmarky2 wrote: |
Please could I have some more 5x5 puzzles? As a long string, or like the ones you did before?
How long does it take to generate one?
|
Here's another. They take about 6s each at 1.6GHz (using Fortran 95 array features and a highly optimizing compiler). You might need to implement naked and hidden triplets too.
Code: |
. . . . . . . . . . . . 15 . . . . . . . . . . . .
. 15 . 25 . 8 . . . 17 . 22 10 9 . 2 . . . 16 . 18 . 13 .
. . . 13 22 24 15 6 12 18 8 . 19 . 2 14 25 7 17 21 4 23 . . .
1 . 17 16 9 21 . 25 . . 14 . . . 18 . . 5 . 23 8 15 10 . 22
18 . 4 . . 22 . 13 . . . . . . . . . 12 . 20 . . 2 . 17
. 9 . . 16 . . 1 23 5 . 15 8 12 . 19 2 18 . . 20 . . 17 .
4 . . 17 . 9 . . 15 16 3 . . . 1 13 5 . . 14 . 7 . . 24
25 11 15 . . . . 12 . 8 5 7 13 18 14 23 . 22 . . . . 3 2 9
3 . 22 . . 17 25 . 2 . 11 . 23 . 19 . 9 . 8 10 . . 15 . 6
. . 14 . 2 . 7 18 . 13 9 . 22 . 24 6 . 15 3 . 23 . 4 . .
. . 2 19 . 23 . 10 25 . 16 . 1 . 3 . 6 14 . 9 . 17 8 . .
. . 7 . 11 . . . 6 . 18 20 . 14 9 . 22 . . . 2 . 13 . .
. 17 5 . 6 1 24 3 . . 22 . . . 12 . . 23 19 2 18 . 14 21 .
. . 13 . 10 . . . 18 . 21 6 . 7 23 . 17 . . . 25 . 24 . .
. . 9 18 . 2 . 8 7 . 24 . 25 . 15 . 1 21 . 13 . 4 20 . .
. . 11 . 18 . 8 2 . 23 19 . 9 . 21 1 . 10 5 . 7 . 17 . .
6 . 25 . . 12 10 . 14 . 20 . 16 . 17 . 8 . 7 24 . . 18 . 5
23 14 12 . . . . 20 . 3 1 8 7 6 22 11 . 17 . . . . 9 25 2
15 . . 2 . 7 . . 9 1 25 . . . 13 21 4 . . 12 . 20 . . 14
. 7 . . 17 . . 21 13 6 . 2 18 3 . 9 14 16 . . 10 . . 19 .
5 . 1 . . 13 . 24 . . . . . . . . . 11 . 25 . . 12 . 3
20 . 23 8 24 18 . 22 . . 2 . . . 11 . . 13 . 3 14 25 7 . 21
. . . 11 25 16 6 19 3 20 13 . 14 . 7 10 12 1 21 5 17 24 . . .
. 21 . 6 . 11 . . . 2 . 19 5 17 . 7 . . . 4 . 22 . 20 .
. . . . . . . . . . . . 24 . . . . . . . . . . . . |
Regards,
Mike Metcalf |
|
Back to top |
|
|
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Sat Jul 05, 2008 9:58 am Post subject: |
|
|
Quote: | Here's another. They take about 6s each at 1.6GHz (using Fortran 95 array features and a highly optimizing compiler). You might need to implement naked and hidden triplets too. |
Hmm I have a class for a generator as well, it takes about 4-5 seconds for me to generate a 4x4. But when I set it generating a 5x5 it takes forever, I left it half an hour and it still hadn't generated one. I was wandering if it's supposed to take significantly longer because its a lot bigger. But I think I know where it' going wrong.
Thanks for the puzzle, I did have hidden and naked singles up to quads, just in my 3x3 program, but they were quite hard techniques, and I dont want to generate them that hard... yet.
I still have the code for them, but i haven't yet changed it so that and grid size can use it.
I'm possibly thinking of doing 6x6 as well, depending on the generate times.
How long does it take you to generate a 4x4?
And how long for a 6x6?
Thanks for the puzzle
Mark |
|
Back to top |
|
|
| mrmarky2
| Joined: 13 Jan 2007 | Posts: 64 | : | | Items |
|
Posted: Sat Jul 05, 2008 1:11 pm Post subject: |
|
|
I have found the problem in the generator for 5x5, it's having problems generating a grid of numbers the same way as I was doing with the 4x4.
How do you generate your grids, if thats what you do?
Thanks
Mark |
|
Back to top |
|
|
| m_b_metcalf
| Joined: 13 Mar 2006 | Posts: 210 | : | Location: Berlin | Items |
|
Posted: Sat Jul 05, 2008 7:28 pm Post subject: |
|
|
mrmarky2 wrote: | I have found the problem in the generator for 5x5, it's having problems generating a grid of numbers the same way as I was doing with the 4x4.
How do you generate your grids, if thats what you do?
|
From an article I wrote some years ago: Quote: |
I decided instead to generate a grid by filling its first row with the nine digits in a random order, obtained using random_number, and then adding subsequent rows of randomly arranged digits, sorting their order as necessary to avoid clashes with digits already in place on previous rows or already in the current box. If this cannot be done, a fresh set of random numbers is used. For the third and sixth rows, an additional check is required that the box constraint is also fulfilled. Also, a deadlock condition can arise when the three digits missing from an almost completed box have already been assigned to a single column above the box. If this occurs, the program restarts. This program worked rather slowly but on looking at it again after a very long summer break, I realized that the sorting algorithm took account of the clash of a digit only in its original position, and not in its possible intended new one. When this was corrected, the program was able to generate a valid grid in less that 1msec. Since it had been written in a parameterized way, it worked too for any square grid from 4 x 4 upwards. Thus it could generate 16 x 16 grids in about 4msecs as well as 25 x 25 in about 60msecs. (All timings are with CVF 6.6C with high optimization on a 1.4GHz PC.) The method slows down beyond that, 36 x 36 grids taking a few seconds and more massive ones being still a ‘work in progress’. (Larger grids not only require more computation, but contain ever more complicated potential deadlock conditions.) |
The 'work in progress' continued until a reasonable 100 x 100 was achieved.
Regards,
Mike Metcalf |
|
Back to top |
|
|
|