Make your own free website on

Programming For Fun

Here are some small programs I've written for fun. Even though they're written in different programming languages, all of them are written in a style called Literate Programming using a system called noweb. This allows the code and its documentation to be written together. One process, called tangling, extracts the source code, ready to be presented to the appropriate compiler, while another process, called weaving, prepares the code and the documentation to be typeset.

Each of these programs is packaged in a zip file. The zip files each contain the noweb source (extension .nw), the woven document (in Adobe Acrobat form, extension .pdf), and one or more tangled source files (extensions depending on language). Some of them may also contain a compiled binary (extension appropriate for the system).

A First Step Into Chaos


A series of SysRPL program for the HP 48 series of programmable calculators to generate and display bifurcation diagrams. While not intended as a tutorial on SysRPL programming, or on programming in general, it illustrates the process I went through while adding features to this program.
Download (214KB) Last updated 2006.04.28

Find Patterns in Text Files

Written in BCPL, this program finds patterns in text files. It accepts metacharacters defining regular expressions (sort of a poor man's grep).
Download (164KB) Last updated 2006.04.27

Compute π (pi)

Written in BCPL, this program computes the decimal digits of π (3.14159...) using Störmer's formula. On my computer it can compute 100,000 digits in just over half an hour. If you have the time, you're welcome to compute a couple million digits. (If you have a lot of time (and memory), the world record is currently over a trillion digits.)
Download (179KB) Last updated 2006.05.01


Enigma was the rotor-based cipher machine used by all branches of the German military during World War II. These programs faithfully emulate both the standard three-rotor variant and the four-rotor variant used by the U-boats. The first program is written in SysRPL for the HP 48 series of programmable calculators, the second is written in BCPL.
Download (HP 48 version 292KB) Last Updated 2006.05.01
Download (BCPL version 220KB) Last Updated 2006.05.16

99 Bottles of Beer

Now for something completely serious. There's a great web site called 99 Bottles of Beer which collects and showcases programs written in various languages to generate the lyrics to the song. As of this writing there are over 900 versions there. My contributions are one written in SysRPL for the HP 48 series of programmable calculators and one for the HP-16C (PDF file only).
Download (148KB) Last updated 2006.04.27
Download (56KB) Last updated 2006.07.13


This page current is and always will be under construction.