Simon Tatham’s Portable Puzzle Collection for Windows Mobile

Screenshot of Galaxies puzzle game running on a Windows Mobile deviceLast week I came across Simon Tatham’s website via a blog posting by Jon Skeet. One of the interesting finds on his website was his Portable Puzzle Collection. This is a series of approximately 27 puzzles which have been architected to be easily ported to new platforms. At present Mac OS X, Unix (using GTK as the GUI toolkit) and Windows builds are officially supported.

Dariusz Olszewski has contributed patches for the existing Windows build to target Windows Mobile (Pocket PC 2003 or higher). I recently submitted a small patch to improve the Windows Mobile port to cope with devices which can dynamically change screen orientation. I have also locally modified the build script to compile with Visual Studio 2005 rather than Embedded Visual C.

I particularly like the Galaxies puzzle, it’s very simple, but addictive at the same time. It also exercises the right side of the brain, as you try to determine if a particular shape will have rotational symmetry.

These games are well worth a look at, and I encourage any C developer with a little spare time to look into improving the Windows Mobile port (source code can be obtained from a SVN repository at svn://ixion.tartarus.org/main/puzzles). These puzzle games are an ideal way to fill in a few spare moments of time.

7 Responses to “Simon Tatham’s Portable Puzzle Collection for Windows Mobile”

  1. Rob Kean says:

    I have VS2005 installed. I’ve been able to compile Simon Tatham’s puzzles for my laptop using the Makefile.vc file that is included in the tarball. But, the Makefile.wce doesn’t work.

    You mention in your post about patching the makefile to work with VS2005. Can you provide any further information on what is required to patch the makefile?

    thanks,
    rob

  2. Hi Rob,

    I emailed a small patch to Simon to correct another minor issue with the Pocket PC port of his puzzle collection, but have not heard back from him so have not cleaned up my other changes.

    You can download a patch file which contains the changes I made from http://www.christec.co.nz/blog/wp-content/uploads/2007/08/vs2005-changes.txt.

    The patch contains changes to two files and adds a new one.

    1. mkfiles.pl – modified to use the VS2005 ARM compiler (it is now called ‘cl.exe’ instead of ‘clarm.exe’).
    2. wceinf.pl – modified to set version max to 5.99 (so the CAB file will install on Windows Mobile 5.0 and 6 devices).
    3. build-ppc.bat – Added this batch file which sets up the environment variables required by Visual Studio 2005 for compiling from the command line and automates the build process.

    To use this patch you will need to install a copy of Perl (ActivePerl is a good Windows friendly choice) onto your development machine. Running the mkfiles.pl script should then produce a new Makefile.wce file for you which will work with Visual Studio 2005.

    You will also possibly need to modify the paths within the first couple of lines of the new build-ppc.bat file. These paths determine which SDK (Pocket PC 2003, WM 5.0 or WM6 etc) the application is built against.

    You should then be able to build the puzzle collection by running build-ppc.bat.

    Are you interested in further improvements of the puzzle collection? I would be interested in further development etc, if I wasn’t working in a vaccum.

  3. Rob Kean says:

    Hey… what developer worth their salt doesn’t have a copy of perl installed… :)

    I reviewed the build-ppc.bat file for the paths you mentioned above. And, I noticed a couple things that I don’t have on my machine…

    In the Path statement, you reference python and unixtools install. What are these used for?

    In the Include and Lib paths, you reference a “Windows CE Tools” folder. I can’t find these on my machine, although I did find a couple different “wce500″ folders under the “ms vs 8\VC” folder, but I don’t know if these are the same. I’m guessing that there’s some SDK that I need to install?

    As for interest in further development… ABSOLUTELY!
    In fact, since I discovered Simon’s puzzles about 6 months ago, I’ve had them on my laptop, and even attempted to convert some of them to utilize the compact framework (Pattern is my favorite). I got too caught up in OOP’ing the code and failed to make much progress. At the time, I had a PPC6700. Now, however, I have a BlackJack, so I’m interested in implementing a SmartPhone interface. I’d definitely need some direction, though, since I wouldn’t know where to begin (all of my development experience is with XP/2000 & Linux, not WM).

    I look forward to hearing back from you.

    -rob

  4. Hi Rob,

    As I mentioned the patch I uploaded is pretty raw, I simply hacked around enough to get it to build on my machine, borrowing from other projects I have on my machine.

    The references in the path statement to python and unixtools should be unnesscary for building the puzzle collection. They came about due to me copying and pasting the batch file from another project of mine (where they are required).

    The reference to the Windows CE Tools directory is rather important. This is how the Visual C++ compiler knows where to find the header files and lib files required to build native Windows Mobile applications.

    Out of the box Visual Studio won’t have this folder. To obtain it you will need to install the seperate Windows Mobile 5.0 Pocket PC SDK (if you have not already). Otherwise it may simply be in a different path on your machine. Have a search for windows.h across your machine and hopefully one of the matches returned will show the right path.

    My desire to work on the puzzle collection is to get them to fit within Windows Mobile better, as well as to support running on a smartphone without touchscreen. I havn’t really done anything other than thinking I may get onto it some day.

    - Christopher

    PS: I havn’t managed to email you. Email sent to your email address seems to bounce back saying it is an invalid email address.

  5. Rob Kean says:

    cool… just check this, and I’m about to head to bed.

    that’s exactly the kind of work I want to do on the puzzles, also. I’ll look into the wm5 ppc sdk tomorrow.

    thanks for the feedback.

    -rob

  6. I’ve released a beta of my port of these games. You can find more details in the following blog entry.

    The port should work on pretty much any Windows Mobile 2003 or above Smartphone or Pocket PC device.

  7. Steve says:

    I have a suggestion for an enhancement that will help users with WM6 touchscreen phones. A right mouse button click should be simulated by a long delay between the MOUSE_DOWN and MOUSE_UP. My phone and apparently several others have no way to simulate a RIGHT click using a combination of a BUTTON + MOUSE_CLICK. This may already have been fixed. Where is the latest version for WM6? The latest I have found is 10/31/07.

    Thanks!

Leave a Reply