Programming Puzzles
An anonymous reader writes "Spotted over at the Economist: 'Sliding-block puzzles look easy, but they can be tricky to solve. The best known is the 15 Puzzle, which became hugely
popular in the late 1870s. This involves square tiles labelled with the numbers 1 to 15, which must be arranged in the correct order inside a four-by-four frame.' While we've all tried these puzzles, the inventor of Quzzle set out to design the easiest looking -
yet most difficult puzzle around and turned to CS to find it. While
the original article touches on it, at the puzzle's site you'll find
Jim Lewis, the inventor, wrote a program in Haskell, a functional programming language to find the best design."
w3ll, 1f j00'r3 50 sm4r+, h0w c0me j00 d1dn'+ g3+ Fr05+ P155?
Yep. Works in OCaml (let a,b = b,a) and a few other languages as well.
And unlike the sad little C/C++ solutions people are tossing around, this works for *any* type, not just ints & chars...
-30-