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


|