Re: Brute force sudoku cracker

2005-09-22 Thread Antoon Pardon
Op 2005-09-21, Tom Anderson schreef <[EMAIL PROTECTED]>: > On Mon, 19 Sep 2005, Antoon Pardon wrote: > >> Op 2005-09-17, Tom Anderson schreef <[EMAIL PROTECTED]>: >>> On Fri, 16 Sep 2005, Bas wrote: >>> -any ideas how to easily incorporate advanced solving strategies? solve(problem1) and

Re: Brute force sudoku cracker

2005-09-21 Thread Tom Anderson
On Mon, 19 Sep 2005, Antoon Pardon wrote: > Op 2005-09-17, Tom Anderson schreef <[EMAIL PROTECTED]>: >> On Fri, 16 Sep 2005, Bas wrote: >> >>> -any ideas how to easily incorporate advanced solving strategies? >>> solve(problem1) and solve(problem2) give solutions, but >>> solve(problem3) gets st

Re: Brute force sudoku cracker

2005-09-21 Thread Tom Anderson
On Wed, 21 Sep 2005 [EMAIL PROTECTED] wrote: > Excellent strategies are provided by Dan Rice's blog: > http://sudokublog.typepad.com/sudokublog/2005/08/two_and_three_i.html There's an interesting remark in this post: http://sudokublog.typepad.com/sudokublog/2005/08/where_do_sudoko.html "Some Su

Re: Brute force sudoku cracker

2005-09-21 Thread david . blume
Bas, you and I are both a little late to the sudoku python experience. Here's my feeble attempt: http://home.earthlink.net/~daliblume/Download/sudoku/index.html Inspired by this article: http://somethinkodd.com/oddthinking/?p=21 Excellent strategies are provided by Dan Rice's blog: http://sudokubl

mathschallenge.net WAS Brute force sudoku cracker

2005-09-19 Thread Caleb Hattingh
Very interesting that sudoku solving appears on the python group - there is a programming competition at mathschallenge.net (euler) where one of the puzzles is developing a sudoku solving algorithm... Actually the python entrants are giving the C guys a good run! On Mon, 19 Sep 2005 09:12:54

Re: Brute force sudoku cracker

2005-09-19 Thread Gerard Flanagan
Anton Vredegoor wrote: > I like to program sudoku and review such > code. Some non-Python examples: APL (The Horror! The Horror!...): http://www.vector.org.uk/archive/v214/sudoku.htm and my own effort with Excel/C# (very humble - needs work): http://exmachinis.net/code/cs/2005/08/4.h

Re: Brute force sudoku cracker

2005-09-19 Thread Antoon Pardon
Op 2005-09-17, Tom Anderson schreef <[EMAIL PROTECTED]>: > On Fri, 16 Sep 2005, Bas wrote: > >> -any ideas how to easily incorporate advanced solving strategies? >> solve(problem1) and solve(problem2) give solutions, but solve(problem3) >> gets stuck... > > the only way to solve arbitrary sudoku

Re: Brute force sudoku cracker

2005-09-19 Thread Antoon Pardon
Op 2005-09-16, [EMAIL PROTECTED] schreef <[EMAIL PROTECTED]>: > > Bas ha escrito: > >> Hi group, >> >> I came across some of these online sudoku games and thought after >> playing a game or two that I'd better waste my time writing a solver >> than play the game itself any longer. I managed to writ

Re: Brute force sudoku cracker

2005-09-18 Thread Gregory Bond
My current solver does 1 level of backtracking (i.e. constant space, and bounded time) only, and it has been able to solve every puzzle I've thrown at it. It's based on the usual logic and book-keeping for the most part. (It also explains how it comes up with each answer step as it goes, wh

Re: Brute force sudoku cracker

2005-09-18 Thread Anton Vredegoor
Diez B. Roggisch wrote: > As everyone posts his, I'll do the same :) It uses some constraint based > solving techniques - but not too complicated ones. When stuck, it > backtracks. So far it never failed me, but I haven't tested it too > thouroughly. Thanks to all for sharing. I like to program su

Re: Brute force sudoku cracker

2005-09-18 Thread [EMAIL PROTECTED]
Had the same reaction as everyone when I saw theses puzzles a month or so ago, so here is my solution... the solve function is recursive, so it can also solve the 'deadlock set' (example3). find_cell looks for an empty cell with the most filled cells in it's row and column, so the search tree doesn

Re: Brute force sudoku cracker

2005-09-18 Thread Diez B. Roggisch
As everyone posts his, I'll do the same :) It uses some constraint based solving techniques - but not too complicated ones. When stuck, it backtracks. So far it never failed me, but I haven't tested it too thouroughly. Diez import copy def condense(vals): if len(vals) == 0: retur

Re: Brute force sudoku cracker

2005-09-17 Thread Bas
>> def all(seq, pred=bool): >What's this? What is bool? That came straight out of the manual for itertools: http://docs.python.org/lib/itertools-recipes.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Brute force sudoku cracker

2005-09-17 Thread David Durkee
Hi Bas, I came across Soduko puzzles recently too and had the same reaction: why waste my time solving the things when it would be much more fun to write a Python program to do so? #!/usr/bin/python import sys import copy import EasyDialogs # Solve functions return these result codes: k

Re: Brute force sudoku cracker

2005-09-17 Thread Benji York
Sybren Stuvel wrote: >>def all(seq, pred=bool): > > What's this? What is bool? See http://docs.python.org/lib/built-in-funcs.html#l2h-10 -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Brute force sudoku cracker

2005-09-17 Thread Pierre Barbier de Reuille
Tom Anderson a écrit : > On Fri, 16 Sep 2005, Bas wrote: > >> -any ideas how to easily incorporate advanced solving strategies? >> solve(problem1) and solve(problem2) give solutions, but >> solve(problem3) gets stuck... > > > the only way to solve arbitrary sudoku problems is to guess. Well, th

Re: Brute force sudoku cracker

2005-09-17 Thread Tom Anderson
On Fri, 16 Sep 2005, Bas wrote: > -any ideas how to easily incorporate advanced solving strategies? > solve(problem1) and solve(problem2) give solutions, but solve(problem3) > gets stuck... the only way to solve arbitrary sudoku problems is to guess. of course, you have to deal with guessing w

Re: Brute force sudoku cracker

2005-09-17 Thread Sybren Stuvel
Bas enlightened us with: > I came across some of these online sudoku games and thought after > playing a game or two that I'd better waste my time writing a solver > than play the game itself any longer. I managed to write a pretty > dumb brute force solver that can at least solve the easy cases >

Re: Brute force sudoku cracker

2005-09-16 Thread my . correo . basura
Bas ha escrito: > Hi group, > > I came across some of these online sudoku games and thought after > playing a game or two that I'd better waste my time writing a solver > than play the game itself any longer. I managed to write a pretty dumb > brute force solver that can at least solve the easy c

Brute force sudoku cracker

2005-09-16 Thread Bas
Hi group, I came across some of these online sudoku games and thought after playing a game or two that I'd better waste my time writing a solver than play the game itself any longer. I managed to write a pretty dumb brute force solver that can at least solve the easy cases pretty fast. It basical