Alphametric fun with Python

Raymond Hettinger python at rcn.com
Thu Jan 15 19:49:49 CET 2009


> > Thought you guys might enjoy this:
> >    http://code.activestate.com/recipes/576615/
>
> Nice and short, but it's also very slow on my PC (Psyco may help).
>
> This solves them in moments:http://labix.org/python-constraint

Intelligent search beats brute force permutation search.
The constraint solver is pretty nice.
The recipe is mainly about how to use itertools.permutations()
for simple programs that take minutes to write and get the job done.

Raymond





More information about the Python-list mailing list