Introduction

As a kid, I spent many hours typing in programs from magazines such as Antic, Analog, and Compute!, as well as from various books such as David Ahl's BASIC Computer Games (1978) and More BASIC Computer Games (1979). After typing in a program and getting it to successfully run, the next step would be to make changes, modify code, add features, etc.

Hammurabi was originally written as 'The Sumer Game' (1969) in FOCAL on a DEC PDP-8 computer, by Richard Merrill. Sometime later, it was ported to PDP-8 BASIC. David Ahl ported this version of Hammurabi to BASIC, and added the 10-year performance assessment.

Back in the day, I also played Atari's Kingdom game program which came on cassette. After looking at the BASIC listing for Hammurabi, Atari's Kingdom seems to be a direct port of Hammurabi, modified to use the Atari screen capabilities.

Porting

I started out with an Atari 400 home computer back in 1982. At the time, I sometimes found it a challenge to get generic BASIC programs such as the programs in BASIC Computer Games and More BASIC Computer Games to work correctly. Atari BASIC handled STRING arrays differently than other 8-bit machines of that era. Atari BASIC was also missing FNA(), FNB(), FNC() types of statements which had to be converted to subroutines. Fortunately, Hammurabi did not require any of these changes.

As Michael Birken's article points out, it is fairly easy to port BASIC programs to C#. To Birkenize a BASIC listing, follow these steps:

As C# uses zero-based indexing and BASIC uses one-based indexing, for array structures, either modify the data to add an unused zeroth element datum, or modify the code to subtract one from the existing indexing logic.

Playing

In the game of Hammurabi, you direct the administrator of Sumeria, Hammurabi, how to manage the city. At the start of the game, Sumeria initially has 1,000 acres of land, a population of 100 people, and 3,000 bushels of grain in storage.

You may buy and sell land with your neighboring city-states for bushels of grain. The price of land will vary between 17 and 26 bushels per acre. You also must use grain to feed your people and as seed to plant the next year's crop.

You will quickly find that a certain number of people can only tend a certain amount of land, and that people starve if they are not fed enough. You also have the unexpected to contend with such as a plague, rats destroying stored grain, and variable harvests.

You will also find that managing just the few resources in this game is not a trivial job over a period, of say, ten years. The crisis of population density rears it head very rapidly.

Share

About the Author

Bill is a senior software engineer. He designs and developments cloud based, web accessible on-demand provisioning system used for provisioning Citrix-based training and demo environments in Visual Studio 2010, .NET Framework, C# and SQL Server 2008. He resides in NJ with his wife Lucy and their dog Yoda.

Prior to web development, he spent seven years in the mobile enterprise space working at companies such as Peak Technologies, Countermind, and Blue Dot Solutions in the Denver, Colorado metropolitan area building enterprise solutions in the .Net Compact Framework, XML and SQL. He also has significant experience in the telecommunication space with various roles at AT&T Bell Laboratories, Lucent Technologies and Avaya where he worked on development and localization of the AUDIX platform and other voice messaging technologies.

Having spend his salad days playing around with his Atari 400, in his spare time, he likes to tinker with game programming, 8-bit computers and the classic arcade machines of his youth.

Comments and Discussions

I remember messing around with (and completely rewriting) Hammurabi on the university's DEC, back in the late '70s. At some point, since it was so different from the original, I renamed it 'Sargon' (not to be confused with a later commercial program by that name).

Stretching my memory, some of my additions were:
1) Army -- I'm pretty sure the original didn't have an army, but rather that I added this.
. one could recruit citizens into the army (they had to be paid in gold)
. with one's army one could attack other city-states and take acreage from them if the battle was a success.
. possibly, the other city-states might also attack you, but I don't remember for sure
2) Wise Men
. one gave the wise men an amout of gold and they would discover fertilizer, irrigation, pest control, medicine, etc, to improve crop yield and storage, reduce severity of plague, etc.
3) Merchants
. one could sell excess grain for gold or buy grain to add into the granary
4) Taxation -- I think. That might already have been in the program, but I think I added a primitive money-economy and taxation.
5) A Looming Disaster
. you had about 20 years in which to build a Ziggurat before a flood swamped the city