JWS’s Puzzle and Cipher Programs

Much of the reason I do these puzzles is because they engage my mind. Of course, there are other things I use to engage my mind as well, including internet roulette.

This is the pentomino puzzle. It is often sold as a plastic puzzle. The 12 pieces are all the possible forms that can be made out of five squares (hence the name ‘pentomino’, by analogy from ‘domino’ which is a shape made of two squares). The object of the puzzle is to fit all the pentominos into a box of size 10 x 6 squares. This is surprisingly difficult, but there are nevertheless thousands of ways to fit the pieces into the box (2339 of them, to be exact, not counting reflections and rotations of the whole box).

In 1988 I made a program that finds all solutions by recursive trial & error and displays them on the screen using text-mode ‘box draw’ characters. Not a very good program, but here it is: pento.zip (.EXE program for ms-dos, with C source code for ms-dos and Unix/Linux). Later I made better (faster) versions, for instance pento3.c (only for Linux/gcc).

However, later I found on Usenet a program by Tenie Remmel, which is clearly much better (penta.zip ). Not only does it run very fast, it has much better structure, so (with permission of the author) I used it as a basis for the experimental programs which follow.

Comments
Simplue WordPress theme is licensed under the GPL.