Screen shot of the Panex Puzzle program Click the illustration to try an online version of the puzzle.

The Panex Puzzle is at first glance very similar to the Tower of Hanoi Puzzle. There are 3 pegs with disks of various diameters. A “tower” of disks of one color on the left peg and a “tower” of disks of another color on the right peg. The towers, like in the Tower of Hanoi puzzle, are arranged with the largest disk on the bottom and the smallest disk on top. There is no law against placing a large disk on top of a smaller disk, but the difficulty is that no disk can ever go below the level at which it starts. The challenge is to exchange the “towers”. Beside the restriction on how far down a peg a disk may go, when a peg is full no disk may be moved over it. A peg is full when the top disk covers the top of the peg.

This puzzle is much more challenging than the Tower of Hanoi puzzle. The solution logic also makes heavy use of recursion like the Tower of Hanoi, but is much more complex. Below are the source files for a program that you can compile and run on a Linux or Unix system or on your PC if you have Cygwin installed. For an explanation of how the solution logic works visit the Panex Page at BaxterWeb.

  File Name      Description   
   game.c       Interface logic for interactive play.   
   panex.c       Command line interface, main program.   
   panex.h       Header file, macros and function prototypes.   
   puzzle.c       Display and animation logic.   
   solution.c       Solution logic.   
   makefile       Make file (for Linux and Cygwin).   
   panex_2.2       Shell archive, contains the files above, requires   
   uudecode, cpio and bzip2 to extract the contents.   
   (Some Unix shells may not process DOS files   
   correctly, so be sure to strip out the carriage   
   returns.)

Last updated: Friday, September 30, 2011 10:56:27 PM