Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Mumps > Puzzle - Constr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 913 of 959
Post > Topic >>

Puzzle - Constraint Logic Programming

by Steve Graham <solitary.wanderer52@[EMAIL PROTECTED] > Dec 6, 2007 at 08:12 AM

One puzzle, that fascinated me years ago, is the sort of thing you
would find in word puzzle magazines.  It is where you substitute
letters for digits and try to figure out which letters represent which
digits.  Byte Magazine used this type of problem to help illustrate
Constraint Logic Programming in an article in early 1995 (http://
www.byte.com/art/9502/sec13/art3.htm).  Here's the particular puzzle
they used:

   D O N A L D
+ G E R A L D
---------------------
   R O B E R T

When I first solved this I was using a different language than MUMPS
and a now ancient computer ( a '286).  Using brute force my program
came up with the solution in 75 minutes.  The article said that there
were "3,628,800 possible assignments of digits to letters".  However,
if I gave the program some clues or constraints, it only took 15
seconds!  One example of a constraint in this case would be the fact
that T would have to be even.  In a way it seems counterintuitive that
adding extra executable code could make a program run faster, but it
is true.

Perhaps we could try to solve this in MUMPS or Cach=E9.  Maybe an
"award" for the shortest routine or one for the fastest routine.


Steve




 2 Posts in Topic:
Puzzle - Constraint Logic Programming
Steve Graham <solitary  2007-12-06 08:12:36 
Re: Puzzle - Constraint Logic Programming
Ed de Moel <demoel@[EM  2007-12-07 17:17:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:07:03 CDT 2008.