Started by cameyo, March 19, 2022, 12:22:18 PM

Previous topic - Next topic


Solve this (each letter represent a different digit):
  LISP *
    FUN =

There are three solution.

p.s. obviously you have to use newlisp :-)


((("e" 9) ("f" 7) ("i" 6) ("l" 2) ("n" 1) ("p" 0) ("s" 4) ("u" 5) ("w" 8))
 (("e" 8) ("f" 2) ("i" 3) ("l" 7) ("n" 1) ("p" 0) ("s" 6) ("u" 5) ("w" 4))
 (("e" 9) ("f" 2) ("i" 8) ("l" 7) ("n" 1) ("p" 0) ("s" 4) ("u" 5) ("w" 6)))


.. and you should dazzle me with the code as well :)

I had a hard time avoiding brute-force, which I thought too boring, but then it started to take too much time for me so I gave up.



Hi Ralph, i have two functions to solve puzzle like this: one uses brute-force and the other uses "amb" :-))">//


Thanks for posting the puzzle and your solution, cameyo!

I found the same 3 you found.  I wish I could post them here but alas I'm getting the Internal Server Error page; so I'll just post a link to the code.  The solution printout is in a comment at the bottom.

Like Ralph, I could not think of anything besides brute-force, but I added a little wrinkle that reduced the number of iterations by 6 times, so that it would run faster and, for that reason, wouldn't be "too boring." :)"> ... ewlisp.lsp">
(λx. x x) (λx. x x)