Hamurabi
David H. Ahl's 1973 BASIC version of Doug Dyment's FOCAL Sumer Game, in which the player rules Sumer for ten years by trading land and rationing grain.
On this page
Hamurabi is a text strategy game: the player rules ancient Sumer for 10 years1, trading land and dividing grain between food and seed. David H. Ahl converted it to BASIC from The Sumer Game, Doug Dyment’s FOCAL program2,3. Dyment based his program on a description of The Sumerian Game4. Game histories place Hamurabi near the root of the strategy genre5,6.
DEC printed the game as HMRABI in 101 BASIC Computer Games, first printed in July 19737. Creative Computing’s 1978 BASIC Computer Games, converted to Microsoft BASIC, printed it as “Hammurabi”8. The atlas names games by release, and Hamurabi here is Ahl’s BASIC version. Wikidata’s item also covers Dyment’s FOCAL program and dates the game 19699.
The code read here is the 1978 listing, transcribed by Lyle Kopnicky for Vintage BASIC and kept by the coding-horror/basic-computer-games project. DEC’s 1975 printing has the same rules and constants except for one comparison in the seed check10.
#The yearly turn
Each year opens with the steward’s report of deaths, arrivals, population, land, the last harvest, rat losses, and the grain in store. The first report shows 100 people, 1,000 acres, and 2,800 bushels11. The book’s description gives the store as 3,000 bushels12, the harvest before the rats took their share.
The player then decides on land, food, and seed, in that order13,14. In the outline below, d5() rolls a whole number from 1 to 5, each equally likely, and rnd() returns a number in [0, 1)15,16.
each year:
report deaths and arrivals; population += arrivals
if plagueRoll <= 0: population = floor(population / 2)
report population, acres, yield, rat losses, store
if this is the 11th report: rate the term and stop
price = 17 + floor(10 * rnd())
buy land at price, paid from the store # buying any land skips the sale
or sell land at price, keeping at least one acre
feed: grain from the store
plant: acres <= owned, acres < TEND * population,
seed = floor(acres / 2) from the store
yield = d5(); harvest = planted * yield
r = d5(); if r is even: rats eat floor(store / r)
store += harvest - rats
arrivals = floor(d5() * (20 * acres + store) / population / 100 + 1)
fed = floor(food / FOOD)
plagueRoll = floor(10 * (2 * rnd() - 0.3))
if fed > population:
nobody dies # the starvation average isn't updated
else:
deaths = population - fed
if deaths > IMPEACH * population: impeached, stop
fold deaths into the average; population = fed
| Rule | Value |
|---|---|
| Land price, drawn once a year | 17 to 26 bushels per acre16 |
Food (FOOD) | 20 bushels per person per year17 |
| Seed | half a bushel per acre14 |
Farming per person (TEND) | 10 acres per person18 |
| Yield | 1 to 5 bushels per acre15 |
| Rats | 2 chances in 519 |
| Arrivals | 20 |
| Plague, halving the population | 20%21 |
Impeachment (IMPEACH), share starved in one year | 45%22 |
| Term | 10 years1 |
The tending check is strict: people may plant acres but not 18. Rats eat from the store left after feeding and seed, before the new harvest goes in19. Arrivals depend on the population before starvation, and they join at the next report20. The remark beside the plague roll says 15%; the formula gives 20%21. An impossible order gets “THINK AGAIN” and the question again, as often as needed; only a negative number ends the game23.
#Land trade
Land is the only thing the city trades, always for grain, so the game’s commodity trading has one good13. Each year draws a fresh price of 17 to 26 bushels per acre16, the same for buying and selling24. A purchase must be paid from the store and rules out a sale that year13. A sale must leave the city at least 1 acre24.
#Starvation and the rating
Everyone not fed dies, and the population becomes the number fed25. Starving more than 45%22 of the people in one year gets the ruler impeached. Ahl added the term and its assessment26,27. At the end of the term, the game rates it on the average yearly share starved, , and the acres per person, 28.
| Fails if | Verdict |
|---|---|
| or | impeached and declared “national fink” |
| or | “smacks of Nero and Ivan IV” |
| or | “could have been somewhat better” |
| passes all three | “a fantastic performance” |
The verdict comes from the first row the ruler fails28. A year with food to spare skips the average’s update, so the next update counts that year at the old average, not 0%29. One bad first year followed by nine years of surplus leaves the first year’s rate as the term’s average29.
#The FOCAL original
Doug Dyment of Digital Equipment of Canada wrote The Sumer Game in FOCAL for the PDP-8, and DECUS listed it as FOCAL-5 in its November 1969 catalog3. Dyment told Kate Willaert that he titled it King of Sumeria and wrote it as a demonstration program4. The DECUS listing survives in the so-much-stuff.com PDP-8 archive.
Ahl kept Dyment’s starting state30 and his rules for seed, the harvest, rats, arrivals, and food31. He changed the rest:
| Dyment (FOCAL) | Ahl (BASIC) | |
|---|---|---|
| Land price | 18 to 22 bushels per acre32 | 17 to 26 bushels per acre16 |
| Length | until the player stops27 | 10 years1 |
| Mass starvation | only kills33 | impeachment22 |
| Plague | 34 | 20%21 |
| Farming per person | up to acres18 | up to 18 |
| Impossible orders | a patience counter, then a strike35 | no limit23 |
Ahl’s BASIC still resets Dyment’s patience counter after each land trade and after feeding, but nothing reads it36.
Dyment’s listing already spells the steward HAMURABI, with one m37. Ahl’s 1978 note blames the missing m on “the Ahl version”, and Richard Moss on an eight-character limit; the DECUS listing predates both37.
#Lineage
The chain runs from The Sumerian Game through Dyment’s FOCAL program to Ahl’s BASIC39.
| Game | Who | Earliest dated evidence |
|---|---|---|
| The Sumerian Game | Mabel Addis and William McKay, for BOCES and IBM40 | a printout of play dated 18 September 196441 |
| The Sumer Game (FOCAL) | Doug Dyment, Digital Equipment of Canada | DECUS catalog, November 19693 |
| Hamurabi (BASIC) | David H. Ahl, DEC | 101 BASIC Computer Games, July 19737 |
Ahl’s 1978 edition credits the FOCAL original to an “unknown” author at DEC26. Dyment heard of The Sumerian Game from a graduate student after a talk at a university in Alberta4. One line survives the chain: Dyment’s steward opens each year with “I BEG TO REPORT”, after The Sumerian Game’s “Sir: I am sorry to report”42.
#Place in the strategy genre
Ahl’s own book grouped the game with “land and resource management games” and told newcomers to start with it47. In BYTE, Jerry Pournelle measured later strategy games against it, calling M.U.L.E. “a cross between Hammurabi, Diplomacy, and an arcade game” and Anacreon “a kind of super Hammurabi”48.
Recent histories put it near the start of the genre. Fraser Brown’s history of the strategy game in PC Gamer calls Hamurabi “a strategy precursor”6. Joachim Froholt of Spillhistorie.no writes that it “is considered a foundational pillar in the strategy genre and an ancestor of today’s city-building and empire-management games”5. Richard Moss’s history of city-building games in Ars Technica calls The Sumer Game “the first computer game to concern itself with matters of city building and management”49. “First” is Moss’s word; The Sumerian Game is earlier50.
#Legacy
DECUS’s 1978 catalog lists a French version of the FOCAL game and RUBEN, “a modification of the ‘King of Sumeria’ game”51. Walter Bright typed in Hamurabi from a book of BASIC listings in high school, expanded it as King at Caltech, and wrote Empire when he tired of it; he credits Empire itself to the film Battle of Britain and the board game Risk52.
Richard Moss counts George Blank’s Santa Paravia and Fiumaccio (1978) as the most notable of the expanded versions that kept “the same core systems”53. Historian Andrea Contato traces a line from Hamurabi’s derivatives to SimCity and Civilization54.
Mechanics
| Mechanic | Kind | How |
|---|---|---|
| Commodity trading | land at 17 to 26 bushels per acre, one price a year for buying and selling |
Every claim about this game, by concept (50)
References
- ^ abcA term is 10 years of decisions; the 11th report ends the game with the rating.Codecoding-horror/basic-computer-games
How we know
10215 PRINT:PRINT:PRINT "HAMURABI: I BEG TO REPORT TO YOU,": Z=Z+143_Hammurabi/hammurabi.bas line 10 at 5301155 · upstream ↗ 21270 IF Z=11 THEN 86043_Hammurabi/hammurabi.bas line 21 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^DEC's printing of the listing opens with a remark that it was "converted from the original FOCAL program and modified for EduSystem 70 by David Ahl, Digital".PublisherAhl, 101 BASIC Computer Games
How we know
10 REM *** CONVERTED FROM THE ORIGINAL FOCAL PROGRAM AND MODIFIED FOR 20 REM *** EDUSYSTEM 70 BY DAVID AHL, DIGITAL
p. 129, lines 10–20 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abcdDECUS's November 1969 catalog lists The Sumer Game, FOCAL-5, by Doug Dyment of Digital Equipment of Canada, "a simulation program/game which will run on a minimal PDP-8 system".PublisherDECUS catalog, November 1969
How we know
This is a simulation program/game which will run on a minimal PDP-8 system. The economy of a Sumerian city in the year 3000 B.C. is simulated in the fashion of a modern-day "business game."
p. 18-A, DECUS No. FOCAL-5 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abcDoug Dyment, then at DEC in Canada, told Kate Willaert he wrote the game, which he titled King of Sumeria, as a demonstration program after a graduate student at a university in Alberta described The Sumerian Game to him.InterviewDyment, interviewed by Willaert (2019)
How we know
“I thought that this would make a good demonstration program,” Dyment told me. “The game as I wrote it was titled King Of Sumeria.”
· archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abJoachim Froholt writes that Hamurabi "is considered a foundational pillar in the strategy genre and an ancestor of today's city-building and empire-management games".WebFroholt 2025
How we know
This game is considered a foundational pillar in the strategy genre and an ancestor of today’s city-building and empire-management games.
· archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^ abFraser Brown's history of the strategy game calls Hamurabi "a strategy precursor".WebBrown 2018
How we know
A text-based management game that tasked players with distributing resources to their citizens, Hamurabi was a strategy precursor that could be found in schools and on mainframes in the ’60s.
· archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^ abcDEC's 101 BASIC Computer Games, first printed in July 1973, includes the game as HMRABI, "Govern the ancient city-state of Sumeria".PublisherAhl, 101 BASIC Computer Games
How we know
1st Printing July 1973
copyright page and contents · archived copy ↗ HMRABI Govern the ancient city-state of Sumeria 128
contents, p. 4 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Creative Computing's 1978 BASIC Computer Games, converted to Microsoft BASIC by Steve North, prints the game as "Hammurabi" on pages 78 and 79.PublisherAhl, BASIC Computer Games (1978)
How we know
Program Conversion by Steve North
title page · archived copy ↗ 10 PRINT TAB(32);"HAMURABI"
p. 79, line 10 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Wikidata's item for Hamurabi also covers Dyment's FOCAL program, under the aliases The Sumer Game and King of Sumeria, and gives 1969 as its year.WikidataWikidata
How we know
+1969-00-00T00:00:00Z
Q1646143 (data/catalog/games.json) · archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^DEC's 1975 printing of the listing has the same rules and constants as the 1978 edition, except that its seed check,
INT(D/2)<S, refuses a planting that would use the last bushel.PublisherAhl, 101 BASIC Computer Games · Ahl, BASIC Computer Games (1978) · coding-horror/basic-computer-gamesHow we know
450 IF INT(D/2)<S THEN 455
p. 129, line 450 · archived copy ↗ 450 IF INT(D/2)<=S THEN 455
p. 79, line 450 · archived copy ↗ 55450 IF INT(D/2)<=S THEN 45543_Hammurabi/hammurabi.bas line 55 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^The first report shows 100 people (95 plus 5 arrivals), 1,000 acres, and 2,800 bushels in store, left from a harvest of 3,000 bushels at 3 bushels per acre after rats ate 200.Codecoding-horror/basic-computer-games
How we know
7100 Z=0: P=95:S=2800: H=3000: E=H-S 8110 Y=3: A=H/Y: I=5: Q=1 ⋮ 12218 P=P+I
43_Hammurabi/hammurabi.bas lines 6–20 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^The book's description starts the city with 3,000 bushels in storage, but the listing's first report shows 2,800, because rats ate 200 of a 3,000-bushel harvest.CodeAhl, BASIC Computer Games (1978) · coding-horror/basic-computer-games
How we know
The city initially has 1,000 acres, 100 people and 3,000 bushels of grain in storage.
p. 78 · archived copy ↗ 7100 Z=0: P=95:S=2800: H=3000: E=H-S43_Hammurabi/hammurabi.bas line 7 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abcThe player may buy land at the year's price if the store covers it, and buying any land skips the chance to sell that year.Codecoding-horror/basic-computer-games
How we know
26322 IF Y*Q<=S THEN 330 ⋮ 29330 IF Q=0 THEN 340 30331 A=A+Q: S=S-Y*Q: C=0 31334 GOTO 400
43_Hammurabi/hammurabi.bas lines 24–31 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abSeed costs half a bushel per acre planted, rounded down, and must come from the store left after feeding.Codecoding-horror/basic-computer-games
How we know
54449 REM *** ENOUGH GRAIN FOR SEED? 55450 IF INT(D/2)<=S THEN 455
43_Hammurabi/hammurabi.bas lines 54–55 at 5301155 · upstream ↗ 62510 S=S-INT(D/2)43_Hammurabi/hammurabi.bas line 62 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abThe yield is a whole number of bushels per acre from 1 to 5, each equally likely, and the harvest is the yield times the acres planted.Codecoding-horror/basic-computer-games
How we know
63511 GOSUB 800 64512 REM *** A BOUNTIFUL HARVEST! 65515 Y=C: H=D*Y: E=0
43_Hammurabi/hammurabi.bas lines 63–65 at 5301155 · upstream ↗ 92800 C=INT(RND(1)*5)+143_Hammurabi/hammurabi.bas line 92 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abcdEach year land trades at bushels per acre for a random in [0, 1), a whole number from 17 to 26.Codecoding-horror/basic-computer-games · Ahl, BASIC Computer Games (1978)
How we know
22310 C=INT(10*RND(1)): Y=C+17 23312 PRINT "LAND IS TRADING AT";Y;"BUSHELS PER ACRE."
43_Hammurabi/hammurabi.bas lines 22–23 at 5301155 · upstream ↗ the price will vary between 17 and 26 bushels per acre
p. 78 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Each person eats 20 bushels a year, so the number fed is the bushels given divided by 20, rounded down.Codecoding-horror/basic-computer-games
How we know
74539 REM *** HOW MANY PEOPLE HAD FULL TUMMIES? 75540 C=INT(Q/20)
43_Hammurabi/hammurabi.bas lines 74–75 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abcdOne person can farm 10 acres, but Ahl's check is strict, so people may plant at most acres, where Dyment's FOCAL allows .Codecoding-horror/basic-computer-games · DECUS FOCAL8-5 source · DECUS FOCAL8-5 write-up
How we know
58454 REM *** ENOUGH PEOPLE TO TEND THE CROPS? 59455 IF D<10*P THEN 510 60460 PRINT "BUT YOU HAVE ONLY";P;"PEOPLE TO TEND THE FIELDS! NOW THEN,"
43_Hammurabi/hammurabi.bas lines 58–60 at 5301155 · upstream ↗ 04.65 I (D-10*P-1)5.1
f0005.fc#L36 · archived copy ↗ one person can plant and harvest 10 acres
p. 1, Abstract · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abA second roll of 1 to 5 sets the rats loose when it is even, 2 times in 5, and they eat the store divided by the roll (half on a 2, a quarter on a 4) before the harvest goes in.Codecoding-horror/basic-computer-games
How we know
66521 GOSUB 800 67522 IF INT(C/2)<>C/2 THEN 530 68523 REM *** RATS ARE RUNNING WILD!! 69525 E=INT(S/C) 70530 S=S-E+H
43_Hammurabi/hammurabi.bas lines 66–70 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abArrivals are , where is a third roll of 1 to 5, the acres, the store after harvest and rats, and the population before starvation.Codecoding-horror/basic-computer-games
How we know
71531 GOSUB 800 72532 REM *** LET'S HAVE SOME BABIES 73533 I=INT(C*(20*A+S)/P/100+1)
43_Hammurabi/hammurabi.bas lines 71–73 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abcA plague halves the population when , which holds for , a 20% chance, though the remark beside it says 15%.Codecoding-horror/basic-computer-games
How we know
76541 REM *** HORROS, A 15% CHANCE OF PLAGUE 77542 Q=INT(10*(2*RND(1)-.3))
43_Hammurabi/hammurabi.bas lines 76–77 at 5301155 · upstream ↗ 13227 IF Q>0 THEN 230 14228 P=INT(P/2)
43_Hammurabi/hammurabi.bas lines 13–15 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abcStarving more than 45% of the population in one year gets the ruler impeached and ends the game.Codecoding-horror/basic-computer-games
How we know
79551 REM *** STARVE ENOUGH FOR IMPEACHMENT? 80552 D=P-C: IF D>.45*P THEN 560 ⋮ 83560 PRINT: PRINT "YOU STARVED";D;"PEOPLE IN ONE YEAR!!!" 84565 PRINT "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY" 85566 PRINT "BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT YOU HAVE"
43_Hammurabi/hammurabi.bas lines 79–86 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abAhl's steward answers an impossible order with "THINK AGAIN" and asks again as often as needed, and only a negative number ends the game.Codecoding-horror/basic-computer-games
How we know
25321 INPUT Q: IF Q<0 THEN 850 26322 IF Y*Q<=S THEN 330 27323 GOSUB 710 28324 GOTO 320
43_Hammurabi/hammurabi.bas lines 24–28 at 5301155 · upstream ↗ 87710 PRINT "HAMURABI: THINK AGAIN. YOU HAVE ONLY" ⋮ 94850 PRINT: PRINT "HAMURABI: I CANNOT DO WHAT YOU WISH." 95855 PRINT "GET YOURSELF ANOTHER STEWARD!!!!!"
43_Hammurabi/hammurabi.bas lines 87–96 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abA sale pays the same price per acre into the store, and the city must keep at least 1 acre.Codecoding-horror/basic-computer-games
How we know
34342 IF Q<A THEN 350 ⋮ 37350 A=A-Q: S=S+Y*Q: C=0
43_Hammurabi/hammurabi.bas lines 32–37 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Everyone not fed dies, and the population becomes the number fed; a surplus kills no one and the population stays.Codecoding-horror/basic-computer-games
How we know
78550 IF P<C THEN 210 ⋮ 80552 D=P-C: IF D>.45*P THEN 560 ⋮ 82555 P=C: D1=D1+D: GOTO 215
43_Hammurabi/hammurabi.bas lines 78–82 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abAhl's 1978 note says the program was "originally written in Focal at DEC; author unknown", and that he converted it to BASIC and added the 10-year performance assessment.PublisherAhl, BASIC Computer Games (1978)
How we know
This program was originally written in Focal at DEC; author unknown. David Ahl converted it to BASIC and added the 10-year performance accessment.
p. 78 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abDyment's program has no term or rating, and after each report it asks whether to continue.CodeDECUS FOCAL8-5 source
How we know
02.60 T !S," BUSHELS IN STORE."!!!"DO YOU WISH TO CONTINUE? 02.70 A " (ANSWER YES OR NO)"Q,!;I (Q-0NO)2.8,7.4
f0005.fc#L14-L16 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abThe final rating tests the average yearly share starved, , and the acres per person, , against three pairs of limits, and the first pair the ruler fails sets the verdict.Codecoding-horror/basic-computer-games
How we know
99865 PRINT D1;"PEOPLE DIED!!": L=A/P ⋮ 102880 IF P1>33 THEN 565 103885 IF L<7 THEN 565 104890 IF P1>10 THEN 940 105892 IF L<9 THEN 940 106895 IF P1>3 THEN 960 107896 IF L<10 THEN 960 108900 PRINT "A FANTASTIC PERFORMANCE!!! CHARLEMANGE, DISRAELI, AND" ⋮ 110940 PRINT "YOUR HEAVY-HANDED PERFORMANCE SMACKS OF NERO AND IVAN IV." ⋮ 113960 PRINT "YOUR PERFORMANCE COULD HAVE BEEN SOMEWHAT BETTER, BUT"
43_Hammurabi/hammurabi.bas lines 97–116 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abA year with food to spare skips the update of the average starvation rate , so the next update counts that year at the old average instead of 0%.Codecoding-horror/basic-computer-games
How we know
78550 IF P<C THEN 210 ⋮ 81553 P1=((Z-1)*P1+D*100/P)/Z
43_Hammurabi/hammurabi.bas lines 78–81 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Dyment's FOCAL program starts from the state Ahl kept, 95 people with 5 arriving, 1,000 acres, and 2,800 bushels after a 3,000-bushel harvest at 3 per acre and 200 lost to rats.CodeDECUS FOCAL8-5 source
How we know
01.10 S P=95;S S=2800;S H=3000;S E=200;S Y=3;S A=1000;S I=5;S Q=1
f0005.fc#L4 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Ahl's BASIC keeps Dyment's rules for seed, the harvest, rats, arrivals, and food, down to the arrivals formula .CodeDECUS FOCAL8-5 source · coding-horror/basic-computer-games
How we know
05.10 S S=S-FITR(D/2);D 8;S Y=C;S H=D*Y 05.20 D 8;S E=0;I (FITR(C/2)-C/2)5.3;S E=S/C 05.30 S S=S-E+H;D 8;S I=FITR(C*(20*A+S)/P/100+1);S C=FITR(Q/20)
f0005.fc#L41-L43 · archived copy ↗ 62510 S=S-INT(D/2) ⋮ 65515 Y=C: H=D*Y: E=0 ⋮ 67522 IF INT(C/2)<>C/2 THEN 530 ⋮ 69525 E=INT(S/C) 70530 S=S-E+H ⋮ 73533 I=INT(C*(20*A+S)/P/100+1) ⋮ 75540 C=INT(Q/20)
43_Hammurabi/hammurabi.bas lines 62–75 at 5301155 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Dyment's land costs 17 plus a roll of 1 to 5, so 18 to 22 bushels per acre, which matches his write-up's average of "one acre for 20 bushels of grain".CodeDECUS FOCAL8-5 source · DECUS FOCAL8-5 write-up
How we know
03.10 D 6;D 8;S Y=C+17;T "THIS YEAR, LAND MAY BE TRADED FOR 03.20 T Y," BUSHELS PER ACRE;";S C=1
f0005.fc#L18-L19 · archived copy ↗ 08.10 S C=FITR(5*FABS(FRAN()))+1
f0005.fc#L54 · archived copy ↗ The price varies from year to year, but averages one acre for 20 bushels of grain.
p. 1, Abstract · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Starvation in Dyment's program only kills, and no number of deaths ends the game.CodeDECUS FOCAL8-5 source
How we know
05.40 S Q=FITR(10*FABS(FRAN()));I (P-C)2.1;S D=P-C;S P=C;G 2.2
f0005.fc#L44 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Dyment's plague halves the population when .CodeDECUS FOCAL8-5 source
How we know
S Q=FITR(10*FABS(FRAN()))
f0005.fc#L44 · archived copy ↗ I (-Q)2.3 02.27 S P=FITR(P/2);T !"HALF THE PEOPLE DIED FROM A PLAGUE EPIDEMIC,
f0005.fc#L8-L9 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Dyment's steward has a patience counter,
C, and when an impossible order finds it below zero, "HAMURABI HAS GONE ON STRIKE" and the game ends.CodeDECUS FOCAL8-5 source · DECUS FOCAL8-5 write-upHow we know
07.10 I (C)7.2;S C=C-1;D 6;T "PLEASE THINK AGAIN. YOU HAVE ONLY";R 07.20 T !"HAMURABI HAS GONE ON STRIKE! YOU WILL HAVE TO STOP 07.30 T !"AND FIND YOURSELF ANOTHER STEWARD!"!!
f0005.fc#L48-L51 · archived copy ↗ S C=1
f0005.fc#L19 · archived copy ↗ Hamurabi's "patience counter"
p. 4, variables · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Ahl's BASIC still sets
Cto 0 after a land trade and to 1 after feeding, values nothing reads before the next dice roll overwritesC, because in Dyment's FOCAL those lines reset the steward's patience.Codecoding-horror/basic-computer-games · DECUS FOCAL8-5 sourceHow we know
30331 A=A+Q: S=S-Y*Q: C=043_Hammurabi/hammurabi.bas line 30 at 5301155 · upstream ↗ 37350 A=A-Q: S=S+Y*Q: C=043_Hammurabi/hammurabi.bas line 37 at 5301155 · upstream ↗ 46430 S=S-Q: C=1: PRINT43_Hammurabi/hammurabi.bas line 46 at 5301155 · upstream ↗ 03.90 S A=A+Q;S S=S-Y*Q;S C=0
f0005.fc#L26 · archived copy ↗ 04.20 S S=S-Q;S C=1
f0005.fc#L30 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^ abDyment's DECUS listing already spells the steward's name
HAMURABI, with one m.CodeDECUS FOCAL8-5 source · Willaert 2019How we know
06.10 T !!"HAMURABI: "%5
f0005.fc#L46 · archived copy ↗ it's unlikely that the misspelling of “Hamurabi” was due to space limitations, as it's also present in the longer DECUS version
2021 Update · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Kate Willaert reports that the game was printed as King of Sumeria in DEC's Focal-8 Demonstration Programs in July 1970, and that Dyment wrote a much more compact revision a year or so after the DECUS version.WebWillaert 2019revised
How we know
King Of Sumeria appeared in the DECUS Program Library Catalog as early as November 1969 under the title The Sumer Game, and under its proper name in DEC’s Focal-8 Demonstration Programs in July 1970.
· archived copy ↗ not Dyment’s much more compact revision from a year or so later
2021 Update · archived copy ↗ The quote matches our archived copy.
Revised after a check by a second AI model, 2026-10-21.
- ^ abHamurabi descends from The Sumerian Game through Dyment's FOCAL Sumer Game, which Ahl converted to BASIC, and which Dyment based on a description of The Sumerian Game.PublisherAhl, 101 BASIC Computer Games · Dyment, interviewed by Willaert (2019) · Willaert 2019
How we know
CONVERTED FROM THE ORIGINAL FOCAL PROGRAM
p. 129, line 10 · archived copy ↗ “I thought that this would make a good demonstration program,” Dyment told me.
· archived copy ↗ the BASIC version that appears in David Ahl's 101 BASIC was adapted from this DECUS version, not Dyment's much more compact revision from a year or so later
2021 Update · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Mabel Addis, a fourth-grade teacher, wrote the instructional version, and William McKay of IBM programmed it.PaperWing et al. 1967
How we know
The instructional version of the game was written by Mrs. Mabel Addis, a fourth grade teacher at the Katonah Elementary School. William McKay of IBM programed the game for the computer.
p. 13, note 1 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^The Strong's Sumerian Game collection holds a teletype printout of play, titled "Sumerian Economic Model", dated 18 September 1964.WebNovakovic 2016
How we know
“Sumerian Economic Model” game teletype printout, September 18, 1964
Series I, Object 3 · archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^Dyment's steward opens each year with "I BEG TO REPORT", and The Sumerian Game reported spoiled grain with "Sir: I am sorry to report".CodeDECUS FOCAL8-5 source · Wing et al. 1967 · Willaert 2019
How we know
02.20 D 6;T "I BEG TO REPORT THAT LAST YEAR"D," DIED OF STARVATION,
f0005.fc#L7 · archived copy ↗ Sir: I am sorry to report that bushels of grain have rotted or been eaten by rats this past season
p. 15 · archived copy ↗ Surprisingly, the DECUS version includes the famous line “I beg to report!”
2021 Update · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Richard Moss dates The Sumer Game to 1968, on a PDP-8 in FOCAL.WebMoss 2015
How we know
He coded The Sumer Game in 1968 on a Digital Equipment Corporation PDP-8 minicomputer, using the FOCAL programming language.
· archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^DECUS's June 1968 catalog lists no FOCAL programs, and its one program by Dyment is a Sentence Generator (8-112).PublisherDECUS catalog, June 1968
How we know
This program generates random English language sentences
DECUS No. 8-112 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Ahl's source note in the DEC book says the FOCAL program "has been floating around DIGITAL for nine or more years".PublisherAhl, 101 BASIC Computer Games
How we know
This is translated from the original FOCAL program which has been floating around DIGITAL for nine or more years.
p. 128, Source · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^The DECUS listing opens with the line
C-FOCAL , 8/68.CodeDECUS FOCAL8-5 sourcerevisedHow we know
C-FOCAL , 8/68
f0005.fc#L2 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Revised after a check by a second AI model, 2026-10-21.
- ^Ahl's 1973 book introduces King as one of the "land and resource management games" and tells newcomers to "start with HMRABI".PublisherAhl, 101 BASIC Computer Games
How we know
This is one of the more comprehensive, difficult, and interesting land and resource management games. (If you've never played one of these games, start with HMRABI).
p. 138, KING · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Jerry Pournelle used Hammurabi as a yardstick for later strategy games, calling M.U.L.E. "a cross between Hammurabi, Diplomacy, and an arcade game" in 1984 and Anacreon "a kind of super Hammurabi" in 1989.MagazinePournelle 1984 · Pournelle 1989
How we know
M.U.L.E. is a cross between Hammurabi, Diplomacy, and an arcade game, with lots of subtle strategic decisions
p. 378 · archived copy ↗ Anacreon (the name is based on one of the barbarian kingdoms in Isaac Asimov's Foundation series), like all the Stellar Conquest derivatives, is a kind of super Hammurabi, with provision for rather simple combat thrown in.
p. 115 · archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^Richard Moss calls The Sumer Game "the first computer game to concern itself with matters of city building and management".WebMoss 2015
How we know
While extremely limited in its simulation, Doug Dyment’s The Sumer Game was the first computer game to concern itself with matters of city building and management.
· archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^The Sumerian Game came out of a partnership between the Board of Cooperative Educational Services (BOCES) of Northern Westchester County, New York, and IBM, and was begun in Cooperative Research Project 1948, which ran from February 1963 to August 1964.PaperWing et al. 1967
How we know
Research Project 1948, which lasted from February 1963 to August '64.
p. ii, Preface · archived copy ↗ The Sumerian Game (already begun in the preceding project), The Sierra Leone Game, and The Free Enterprise Game.
p. 12 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^DECUS's 1978 PDP-8 catalog lists a French "version of HAMURABI (the Sumer Game)" by J. F. Champarnaud and F. H. Bostem of Liège, and RUBEN, "a modification of the 'King of Sumeria' game" by James R. B. Howard II and Jimmie B. Fletcher.PublisherDECUS PDP-8 catalog, August 1978
How we know
This French language version of HAMURABI (the Sumer Game) is available on both paper tape and PDP-12 LINCtape.
p. 71, FOCAL8-186 · archived copy ↗ A modification of the "King of Sumeria" game. Problems with the random number generator have been corrected and some additional features have been added.
p. 83, FOCAL8-305 · archived copy ↗ Checked against the evidence by its author, an AI model, 2026-10-20.
Checked by a second AI model, 2026-10-21.
- ^Walter Bright says he typed in Hamurabi from a book of BASIC listings in high school, expanded it at Caltech under the name King, and turned to Empire when he tired of it.Dev blogBright 2000
How we know
One that interested me was printed in a book of Basic game listings, called Hamurabi. I punched it in, and started to modify it. … I got the operator to load in my Hamurabi deck, renamed it to King, and spent the next semester learning how to enhance it. … Tiring of King, I remembered that old game I'd invented as a kid.
Prehistory, First Versions · archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^ abRichard Moss counts George Blank's Santa Paravia and Fiumaccio (1978) as the most notable of the "expanded versions" of The Sumer Game that kept "the same core systems".WebMoss 2015
How we know
several more expanded versions soon emerged, with different localities but the same core systems. Of these, George Blank’s 1978 Apple II game Santa Paravia and Fiumaccio was perhaps the most notable
· archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
- ^Historian Andrea Contato says others used Hamurabi as inspiration for derivative games, and that the city and empire management genre that followed led "to titles like SimCity and eventually Civilization, much later".WebFroholt 2025
How we know
Others used it as inspiration to build derivative games, and the city/empire simulation-management genre became highly popular, leading to titles like SimCity and eventually Civilization, much later.
· archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-21.
Sources
Code
- Atwood, Jeff and basic-computer-games contributors. 2026. “BASIC Computer Games, updated for 2022 (coding-horror/basic-computer-games).” Commit 5301155. coding-horror/basic-computer-games @ 5301155 · licence, all uses
- Dyment, Doug. n.d. “The Sumer Game, FOCAL source (DECUS FOCAL8-5).” Digital Equipment Computer Users Society (DECUS). svn revision 6211. original · archived · licence, all uses
Primary
- Ahl, David H. 1975. “101 BASIC Computer Games.” Digital Equipment Corporation. original · archived · licence, all uses
- 1969. “DECUS Program Library Catalog, November 1969.” Digital Equipment Computer Users Society (DECUS). original · archived · licence, all uses
- Dyment, Doug and Kate Willaert. 2019. “Doug Dyment on King of Sumeria, interviewed by Kate Willaert.” A Critical Hit!, in “The Sumerian Game: The Most Important Video Game You've Never Heard Of”. original · archived · licence, all uses
- Ahl, David H. and Steve North. 1978. “BASIC Computer Games: Microcomputer Edition.” Creative Computing; Workman Publishing (trade edition). original · archived · licence, all uses
- Dyment, Doug. n.d. “The Sumer Game: DECUS Program Library Write-up, FOCAL8-5.” Digital Equipment Computer Users Society (DECUS). original · archived · licence, all uses
- Wing, Richard L., Mabel Addis, Walter Goodman, Jimmer Leonard, and William McKay. 1967. “The Production and Evaluation of Three Computer-Based Economics Games for the Sixth Grade: Final Report.” U.S. Office of Education, Cooperative Research Project 2841 (ERIC ED014227). Board of Cooperative Educational Services, First Supervisory District, Westchester County, New York. original · archived · licence, all uses
- 1968. “DECUS Program Library Catalog, June 1968.” Digital Equipment Computer Users Society (DECUS). original · archived · licence, all uses
- 1978. “DECUS PDP-8 Program Library Catalog, August 1978.” Digital Equipment Corporation. original · archived · licence, all uses
- Bright, Walter. 2000. “A Brief History of Empire.” Digital Mars (classicempire.com). original · archived · licence, all uses
Secondary
- Froholt, Joachim. 2025. “The Sumerian Game: The ancestor of modern city builders.” Spillhistorie.no. original · archived · licence, all uses
- Brown, Fraser. 2018. “The history of the strategy game.” PC Gamer. original · archived · licence, all uses
- Wikidata contributors. 2026. “Wikidata.” Wikimedia Foundation. original · licence, all uses
- Willaert, Kate. 2019. “The Sumerian Game: The Most Important Video Game You've Never Heard Of.” A Critical Hit! original · archived · licence, all uses
- Novakovic, Julia. 2016. “Finding Aid to the Sumerian Game Collection, 1962–1967, 2015.” Brian Sutton-Smith Library and Archives of Play, The Strong. original · archived · licence, all uses
- Moss, Richard. 2015. “From SimCity to, well, SimCity: The history of city-building games.” Ars Technica. original · archived · licence, all uses
- Pournelle, Jerry. 1984. “Computing at Chaos Manor: NCC Reflections.” BYTE 9, no. 12 (November 1984), pp. 361–378. McGraw-Hill. original · archived · licence, all uses
- Pournelle, Jerry. 1989. “Computing at Chaos Manor: To the Stars.” BYTE 14, no. 1 (January 1989), from p. 109. McGraw-Hill. original · archived · licence, all uses