Software I’ve written

I spend too much time sitting in front of computers; one useful by-product is that every now and then I write a useful program. Here are some.

All the software on this page comes with source code and documentation. And it’s all free; you don’t have to pay for it, and you are at liberty to modify or redistribute it (and, in some cases, both at once).

Forward links within this page:

Portable-ish things

3col, version 2.09

is a program for converting text files into PostScript, similar in spirit to things like ‘enscript’. I like it better than any of the other programs I’ve seen that perform similar functions.

It’s extremely flexible; it allows a limited amount of mark-up; its output looks pleasant; it’s well documented; I think it’s portable. It comes with a couple of useful Perl scripts that you can use in conjunction with it for printing Unix manpages and Perl ‘pod’ documentation quite prettily.

In case you’re wondering about the name: the first version always formatted its input into three columns on landscape-format A4 paper; hence ‘3col’. The current version is much more flexible.

You might like to have a look at the main documentation file, which describes the features of 3col, or indeed to browse the distribution.

Download: 3col-2.09.tar.gz (gzipped tarfile; 30k)

disarm, version 0.11

is a simple disassembler for ARM machine code. It consists mostly of code ripped viciously from objdism. It’s deliberately simple-minded; if you have a use for it then you are encouraged to customise it to fit your needs.

Download: disarm.c-0.11 (C source code; 32k)

fmt, version 1.5

does some primitive formatting on text. As of June 2001, it’s the version of fmt in FreeBSD. (I wrote it because I was annoyed at the poor quality of the old BSD fmt.) I don’t particularly recommend getting this, because there’s an even better fmt in the GNU ‘textutils’ package. But if for some reason you don’t like the General Public License, you may prefer this (which has a BSD-style licence).

Download: fmt.c (C source code; 21k)

gossip (no version number)

plays a not-very-well-known and not-very-exciting board game called ‘Oska’. I wrote it because it seemed to me that it ought to be a game computers would play very well; it turns out that they play well enough to solve the game in a few seconds. The code is rather a mess, but the program plays a good game. It also includes a brief description of how to play.

The Spark archive below (for RISC OS machines only) contains the source code and three executables, with different levels of memory consumption: smallest=slowest.

Download: gossip.c (C source code; 38k)
Download: gossip.arc (Spark-format archive, for RISC OS machines; 48k)

make-maze, version 1.02

makes mazes based on hexagonal grids, using an elegant algorithm (not my own). It’s very quick; it outputs very compact PostScript; it has an option to produce mazes with or without solutions (or both). It will probably compile and run without much pain on any Unix system; fixing it for others would be trivial, but I haven’t done it yet. There isn’t any documentation, but the program is quite well commented.

You might be interested in the web page that inspired me to write the program. If you look at the description of how long the program described there took to create a big maze and how big its output files are, you’ll understand why I wrote mine.

Download: make-maze-1.02.tar.gz (gzipped tarfile; 10k)

You might want to have a look at some mazes produced by it; each is a two-page PostScript document, the second page containing the solution. There are gzipped versions of all of them.

10x12.ps (4k); 10x12.ps.gz (1.4k)
45x50.ps (7k); 45x50.ps.gz (3k)
90x100.ps (15k); 90x100.ps.gz (6k)
150x170.ps (34k); 150x170.ps.gz (14k)
360x400.ps (160k); 360x400.ps.gz (63k)

munge-web, version 1.00

is a preprocessor for Web pages. I use it to separate content from presentation. For instance, my own pages exist in two versions, one for my local machine and one served from my ISP’s web server; the two versions have different sets of pages, slightly different text, and different layout. I build both sets from the same source using munge-web.

I regret that the documentation for munge-web isn’t terribly good. It’s all contained in a big comment at the start of the script.

munge-web has only been tested on my Unix machine; I don’t know how well it would work on other operating systems. I’m certain that it will be fine on any Unix machine.

Download: munge-web.py (Python source code; 15k)
Download: mw-common (a sample "presentation model" file; 2k)
Download: mw-input (a sample input file; 16k)

qsort, version 1.16

is an implementation of the ANSI C qsort() routine. I wrote it largely because the qsort in my home machine’s C library was disastrously broken. It’s quite large (4k of object code on my machine) but performs well.

[2021-02-20]
version 1.15 replaced by version 1.16, fixing yet another serious bug.
[2016-03-11]
version 1.14 replaced by version 1.15, fixing yet another serious bug. I have now written some test code that exercises it pretty thoroughly.
[2016-02-21]
version 1.13 replaced by version 1.14, changing the licence to something more standard and clarifying that you should probably only use this is you suspect your platform’s libc qsort is bad.
[2007-09-02]
version 1.12 replaced by version 1.13, fixing another serious bug (thanks to Dan Bodoh for the report)
[1998-03-20]
version 1.11 replaced by version 1.12, which fixes some serious bugs

Download: qsort.c-1.16 (C source code; 16k)
Download: qsort-tests.c (test harness; 8k)

race3 (no version number)

is a program for analysing backgammon endgame positions. It does this by exhaustive search, so it can only cope with rather late endgames. I’m afraid it’s written using a literate programming system (Marc van Leeuwen’s CWEBx), which means that the main source file combines code and documentation... so it’s of limited use to you if you don’t have the tools to extract compilable C code from it.

For this reason, I’m distributing the ‘tangled’ C source code as well; if you don’t have CWEBx on your system you should get that. (But if you want to understand the code you should read either the CWEBx source, or the documentation produced from it.)

Download:

  • race3.w (the CWEBx source code; 27k)
  • race3.c (the unreadable but compilable C source code; 18k)
  • race3.tex (the TeX documentation; 43k)
  • cwebmac.tex (a TeX macro file you’ll need to process the .tex file; 15k)
  • race3.ps.gz (the result of TeXing race3.tex and converting to PostScript, gzipped; 63k)
  • README (a brief description of the program; 2k)
  • race3.tar.gz (all of the above, plus the DVI file produced by TeX; 115k)
vn-nats (no version number)

is a hack that generates PostScript drawings of the von Neumann natural numbers. If you don’t know what that means, you probably don’t want the program, though you might still find the sample output pretty. The program itself is written in Common Lisp; I apologize if that scares you. There are no comments or anything, but if you know any Common Lisp you shouldn’t have trouble making it work.

Download: vn-nats.lisp (Source code; 3k)
Download: 12.ps.gz (sample output; 12k)

RISC OS things

(RISC OS is the operating system used by the desktop computers made by Acorn. Until a fewmany years ago, one of the machines I used at home was a RISC OS one. The following stuff is unlikely to interest you unless you’re a RISC OS user yourself.)

blowfish, version 1.00

is an implementation of Bruce Schneier’s Blowfish cipher, as a RISC OS relocatable module. It can be used as a drop-in replacement for the Blowfish module written by Andy Armstrong of Wonderworks, but provides many facilities not offered by that module.

Download: blowfish-1.00.arc (Spark-format archive, for RISC OS machines; 118k)

clockmem, version 1,24

displays the time and the amount of free memory you have on one iconbar icon, and only takes up 4k of memory. It also lets you set a single alarm, which is all I ever used !Alarm for anyway.

Download: clockmem-1.24.arc (Spark-format archive, for RISC OS machines; 44k)

fmulc, version 1.10

is a program that produces C or ARM assembly language code for doing approximate multiplication of an integer by a constant between 0 and 1. You might find this useful if you want an approximate division-by-123 routine, or something.

You can in fact use it to synthesize pretty efficient exact division routines (with a bit of post-processing), but I can’t be bothered to explain how. (There’s a bit of information in the usage instructions at the start of the file.)

Download: fmulc.c-1.10 (C source code; 16k)

makealf, version 1.08

is a sort of replacement for Acorn’s libfile program. It allows you to create object code libraries. Its current version is better than libfile in almost every respect.

Download: makealf-1.08.arc (Spark-format archive, for RISC OS machines; 104k)

mkdrawf, version 3.10

is a tool for creating drawfiles. It’s actually quite a powerful (but nasty) programming language in its own right. Also included: a tool for performing the reverse translation (so you can modify drawfiles in various ways by converting them to mkdrawf source, munging them with your favourite text editor or Perl or whatever, and running through mkdrawf), a Wimp front end for these, and copious documentation.

Version 3.10 (released 1998-09-13) is much nicer than the previous version; in particular, the syntax is much less painful than it used to be.

In the longer term, I intend to release something that does all the same things but much much more nicely (being a decent programming language in its own right). Either that, or integrate the functionality of mkdrawf with Python or something. Watch this space.

Download: mkdrawf-3.10.arc (Spark-format archive, for RISC OS machines; 549k)

The Impression version of the manual now uses some fonts in the Goudy family (free, so far as I am aware, and much nicer to read than Times/Trinity). You can download them here, in one of two forms.

Download: goudy.arc (Spark-format archive, including Type1 data for printing with PostScript printers; 429k)
Download: goudy0.zip (ZIP-format archive, excluding Type1 data; 151k)

The ZIP file was created on my Unix box when I realised that many people won’t want the Type 1 files. This means that it doesn’t contain any filetype information. You should set all the files in it to type &FF6. You can do that by downloading goudy-st (text; 361b), making it of type Obey and running it.

objdism, version 0.10beta

is a tool for converting an AOF file into assembly language code that can be run through ObjAsm to produce a functionally equivalent AOF file. Useful if you want to see what’s inside an object file, or if you want to make small changes (or large changes) to one.

ObjDism’s output is readable and reasonably friendly; it should also be easy to modify without damaging things. Oh, and it gives quite extensive information about the contents of debugging tables too.

Don’t be discouraged by the version number. It seems to be stable, and it works well. The ‘beta’ just means: if you use this, please let me know how well it fits your needs.

Download: objdism-0.10beta.arc (Spark-format archive, for RISC OS machines; 155k)

PGP, version 2.6.3i

is a port of, errrm, PGP version 2.6.3i. PGP is a widely used system for strong cryptography. You can find out more about PGP at Pretty Good Privacy, Inc.’s home page, but note that this covers a later version of PGP than this one. (But not as much later as the version number might lead you to think.)

More useful information is on the International PGP Home Page.

At one time I was contemplating porting a more recent version of PGP to the RISC OS platform. I no longer have any intention of doing so. Anyone who wants to do it is welcome to use anything I did for the 2.6.3i port.

Note: If you got a copy of this any time before 1998-12-03, then there is a bug in your copy. It doesn’t affect security at all, but it’s a nuisance. (The filenames embedded in encrypted messages aren’t properly canonicalised.)

Download:

  • pgp263i.arc (Spark-format archive; 927k)
  • pgp263if-BROKEN.arc (Spark-format archive; 1226k) -- includes also some files not needed on the RISC OS platform, and original versions of files I had to change. Spark-format archive; 1226k. The BROKEN is because this still has the bug mentioned above.