For Programmers: Free Programming Magazines  


Home > Archive > Fortran > December 2005 > Re: Write a Fortran program to solve Sudoku puzzles :-)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Write a Fortran program to solve Sudoku puzzles :-)
Kay Diederichs

2005-12-05, 8:08 am

Michael Metcalf wrote:
> "James Parsly" <japarsly@nospam.tva.gov> wrote in message
> news:newscache$u7xvqi$o4b$1@lyris.knx.tva.gov...
>
>
> Try the one I posted earlier today!
>
> Regards,
>
> Mike Metcalf
>
>

I believe you mean
3 5
9 6
6
5 2 8
84 73
4 9 7
4
1 4
6 8
?


My little Fortran program tells me that

146375829
395281764
782964531
567123498
928457316
431896257
673549182
819732645
254618973

solves that puzzle, but e.g.

146375289
395281764
872964153
567123498
928457316
431896527
283549671
619732845
754618932

is also a solution (my program found all 10868 solutions in 0.3 seconds).

However, wikipedia says that ...
=============
Construction

It is possible to set starting grids with more than one solution and to set
grids with no solution, but such are not considered proper Sudoku puzzles; like
most other pure-logic puzzles, a unique solution is expected.
=============

.... which the above puzzle does not meet.

Does anybody know what the (uniquely solvable) sudoku with the smallest number
of preset numbers is?

Kay
------------ And now a word from our sponsor ---------------------
For a secure high performance FTP using SSL/TLS encryption
upgrade to SurgeFTP
---- See http://netwinsite.com/sponsor/sponsor_surgeftp.htm ----
Herman D. Knoble

2005-12-09, 7:18 pm

Mike: I'm sorry that I messed this up. I canceled the posting.
Skip

On Fri, 09 Dec 2005 17:37:15 GMT, "Michael Metcalf" <michaelmetcalf@compuserve.com> wrote:

-|
-|"Herman D. Knoble" <SkipKnobleLESS@SPAMpsu.DOT.edu> wrote in message
- |news:q0fjp1lu8mhj77l6tehvd2lgiqj8ch8nuq
@4ax.com...
-|> Mike: I posted a reference to a TCL Sudoku solver today.
-|> Running your puzzle with it produces:
-|[snip]
-|
-|Thanks, pal. I hope people interested in doing it the hard way don't see
-|your post!!!! Like I've said before, using programs is boring.
-|
-|Mike
-|

Michael Metcalf

2005-12-09, 7:18 pm


"Herman D. Knoble" <SkipKnobleLESS@SPAMpsu.DOT.edu> wrote in message
news:nrhjp19uo03f902rp09chlr950rtui9lm1@
4ax.com...
> Mike: I'm sorry that I messed this up. I canceled the posting.
> Skip
>

Skip,
Thanks, no sweat. By way of upping the ante, here is a supersudoku
(16x16). Masochists can ask me by e-mail for a megasudoku (25x25, perhaps
too big to fit in here). I'll post the solution next Friday. It takes my
program 330msecs to solve this.

Regards,

Mike

2 0 0 0 0 0 9 0 0 0 0 0 14 1 0 15

0 0 0 1 0 0 0 0 0 0 0 8 6 9 0 0

0 0 0 0 0 0 0 0 0 10 0 1 0 0 13 7

0 11 0 0 6 10 0 0 0 0 7 12 0 0 0 0

0 0 0 0 0 6 1 14 10 12 0 3 0 0 0 0

6 0 0 4 0 0 0 13 16 0 0 0 7 0 0 0

0 0 10 0 0 11 0 0 0 0 8 0 0 14 16 0

9 0 0 13 16 0 0 2 0 0 0 4 5 0 0 11

16 0 0 15 5 0 0 0 7 0 0 14 9 0 0 0

0 13 11 0 0 7 0 0 0 0 3 0 0 12 4 0

12 0 0 2 0 0 0 4 6 0 0 0 3 0 0 14

0 0 0 0 15 0 13 6 8 0 1 11 0 2 0 0

0 7 0 0 8 13 0 0 0 0 4 16 0 0 0 0

10 1 0 0 3 0 12 0 0 6 0 0 0 0 14 5

0 0 15 3 1 0 0 0 0 0 0 2 4 13 9 0

5 0 16 0 0 0 0 0 0 3 0 0 10 7 0 6






Jan Vorbrüggen

2005-12-12, 8:17 am

> By way of upping the ante, here is a supersudoku (16x16).

Of course, such a puzzle should be using 0-9, A-F instead of 1-16 for
its digits...

Jan
Michael Metcalf

2005-12-12, 8:17 am


"Jan Vorbrüggen" <jvorbrueggen-not@mediasec.de> wrote in message
news:4052qcF18f7c8U1@individual.net...
>
> Of course, such a puzzle should be using 0-9, A-F instead of 1-16 for
> its digits...
>

In fact, 1-9, A-G is sometimes used.

Regards,

Mike


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com