You are Hammurabi, ruler of a city in ancient Sumer. Each year your steward reports the harvest, the people who starved or arrived, and the grain the rats ate; then you decide how much land to buy or sell, how much grain to feed your people and how many acres to plant. That is the whole game, and it is one of the ancestors of every city-building and strategy game since.

Doug Dyment wrote it at DEC in 1968, in FOCAL, for the PDP-8. It was based on The Sumerian Game, an educational simulation written a few years earlier by Mabel Addis and William McKay for an IBM mainframe. Dyment's short version fitted on a minicomputer and spread with FOCAL; David Ahl later rewrote it in BASIC, and in that form it reached a whole generation of home computers. The program in this room is the FOCAL one, which spells its own name "HAMURABI".

How to play

The program is loaded and running when you sit at the ASR-33. You begin with about a hundred people, 1,000 acres and 2,800 bushels of grain in store. Every year it asks, in turn:

  1. How many acres to buy, at the year's price (around 20 bushels an acre).
  2. How many to sell, if you bought none.
  3. How many bushels to use as food. Each person needs 20 bushels a year; those who don't get them starve.
  4. How many acres to plant. Sowing takes one bushel of seed for every two acres, and each person can work ten acres.

Then the year passes: the harvest comes in at a few bushels an acre, rats may eat part of the store, new people arrive if the city is doing well, and now and then the plague takes half the population. If you ask for more grain, land or people than you have, the steward says so and asks again. A negative answer ends your reign.

Strategy

The tension is between eating and planting. Grain fed to people this year is grain you can't sow for next year; land is cheap in some years and dear in others, so the store is also your bank. A good ruler keeps everyone fed, never leaves land unworked for lack of seed, and buys land when the price is low.

In the classroom

Hammurabi is a model of a small economy in four numbers, and its rules are all in a listing short enough to read in one sitting. Play a few years, then work out from the listing how the harvest, the rats and immigration are decided: it's a good first look at how a simulation turns rules into random events.

More to try

Lunar Lander is the other classic FOCAL game, and FOCAL is there to write your own.