Damian Walker

Personal Web Pages

Back to BASIC Games with Hammurabi

Saturday, 24th August 2019

Having spent quite a bit of time on the Tiny BASIC implementation and its manual, I'm starting to miss writing the little games that it will eventually compile. I've already written some of the classic numerical games like hurkle, mugwump, wumpus and lunar lander. So it's time to tackle Hammurabi.

Originally written in 1969 as "The Sumer Game", Hammurabi (often spelt Hamurabi) is a game where you manage an ancient city state. Resources are people, land and grain. People farm the land to produce grain; grain feeds the people, seeds the land to produce next year's grain, and acts as a currency for buying and selling the land. Land prices, harvests and immigration are randomised, as is the amount of grain lost to rats. Random plagues halve your population.

I've yet to find a description of gameplay detailed enough to allow me to reproduce it. I've managed to piece together most of the details from articles and sample game output. I want to avoid looking at existing source code, but I may have to take a peek to fill in the final details I'm missing.

As with the other games so far, I want to initially test Hammurabi on Tom Pittman's interpreter with the aid of my AWK script to fill in omitted line numbers. That way I know I have a working BASIC program that I can use to test my own Tiny BASIC interpreter.