Re: Alphametric fun with Python

2009-01-16 Thread Terry Reedy
bearophileh...@lycos.com wrote: Terry Reedy: It illustrates well the point you intended. I don't know what my point was. I quoted and was responding to Raymond. A suggestion: with that solver, to find solution in a faster way you have to write many equations. I did... one for each colum

Re: Alphametric fun with Python

2009-01-16 Thread bearophileHUGS
Terry Reedy: >It illustrates well the point you intended. I don't know what my point was. A suggestion: with that solver, to find solution in a faster way you have to write many equations. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Alphametric fun with Python

2009-01-15 Thread Terry Reedy
bearophileh...@lycos.com wrote: Raymond Hettinger: for simple programs that take minutes to write and get the job done. Thank you for posting this. It illustrates well the point you intended. For fun here's a specific example: from csp import Problem, timing print "SEND+MORE=MONEY problem:

Re: Alphametric fun with Python

2009-01-15 Thread bearophileHUGS
Raymond Hettinger: > for simple programs that take minutes to write and get the job done. For fun here's a specific example: from csp import Problem, timing print "SEND+MORE=MONEY problem:" p = Problem("recursivebacktracking") p.addvars("sendmory", range(10)) p.addrule(lambda d,e,y: (d+e)%10 == y

Re: Alphametric fun with Python

2009-01-15 Thread Raymond Hettinger
> > 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 constrain

Re: Alphametric fun with Python

2009-01-15 Thread bearophileHUGS
Raymond Hettinger: > 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 Bye, bearophile -- http://mail.python.org/mailman/listinfo/p