A Krypto puzzle solver written in Haskell.
The Krypto deck consists of 56 cards: three of each of the numbers 1-6, four each of the numbers 7-10, two each of 11-17, one each of 18-25. Six cards are dealt: a common objective card at the top and five other cards below. Each player must use all five of the cards' numbers exactly once, using any combination of arithmetic operations (addition, subtraction, multiplication, and division), to form the objective card's number. The first player to come up with a correct formula is the winner. – Wikipedia
$ ghc -O2 --make dekrypto
-
*nix:
$ ./dekrypto [-H|-h]
-
Windows:
> dekrypto.exe [-H|-h]
-H : Use house rules (allow intermediate results to be negative and/or fractional) -h : Show the help message
... $ ./dekrypto Cards (separated by spaces): 1 4 7 10 13 Goal: 9 1 + (4 + (7 - (13 - 10))) = 9 Solved in 0.01258 seconds
... $ ./dekrypto -H Cards (separated by spaces): 1 4 7 10 13 Goal: 9 1 + (4 + (7 + (10 - 13))) = 9 Solved in 0.000326 seconds