Return to Samples of My Work

HAMURABI - Where you govern the ancient kingdom of Sumeria. The object is to keep the kingdom growing.

Acres of land:            How many acres do you wish to
trade? Buy Sell
Population: How many bushels do you wish to
feed your people?
Stored grain: How many acres do you wish to
plant with seed?
Price of land:

This is based on a BASIC game written long ago... in fact, it's one of the first games I ever played on a computer.

To play, simply select "buy" or "sell", type the numbers of your choice, and click the "Go" button to go on to the next year. I find that the easiest way to play is using the numpad and the tab key, and leave the mouse alone unless you want to sell some land.

Obviously some crucial information is missing that would help you play the game, but that's intentional -- the original game left it out too. Part of the fun is figuring out the correct ratios to keep your economy running optimally. And by the way, I KNOW that the proper spelling is "Hammurabi". The original game misspelled it too, and I wish to keep that aspect of it.

You can download a copy of the original game from ZDnet, where I found it. I decided to rewrite it to correct a serious flaw. If you enter a number that is too large to read (about 32000) then it will roll over into a negative number. At this point the game becomes unplayable. This version should handle number pretty much as high as you want to go.

Finally, I wish to acknowledge Jeff Halbgewachs, who wrote the only other Javascript version of Hamurabi that I could find. Some sections of my code and the overall structure are borrowed from his, but most of it is rewritten entirely based on the original BASIC. I played Jeff's version but found it differed from the original in several important ways. The game ends after ten years, after which you receive a grade; and you can lose instantly if you starve too many people. I feel that this is not true to the spirit of the original game, so in this version your only goal is to keep acquiring more and more. The heck with ending conditions, that's my motto, the game is over when you say it is.

If you want to start over, hold down the control, shift, or meta button while you click refresh, depending on which browser you use.

Return to Samples of My Work