
Hammurabi: Classic game of strategy and resource allocation - ingler
http://www.hammurabigame.com
======
mcphage
It seems like if you sell off a little land in the first few years to plant as
much land as possible, you'll keep having enough wheat everything going.
Within a few years you'll be able to buy that back and then some.

And then you have a plague.

------
erikb
I don't get why people criticise the game here. If I understand correctly it's
not really a remake but a copy of an old game which was simply made available
to us with all it's flaws, bugs and other happy memories.

~~~
simonh
Hammurabi has been my go-to project to recreate in many of the languages I
learn since the 80s. It's just complex enough that you can usefuly experiment
with various features of a new language.

IMHO it's a case where the bugs are a feature. It's simple to implement but
there are numerous small ways you can tweak it to make improvements. That make
it a fantastic project for learning to program because completing the initial
clone version is really just the starting point.

~~~
erikb
I think that's a really smart way to improve your coding. Recoding an old game
is nothing too hard but offers enough challenges that you really need to use
the features of the language you are learning.

------
strawman
Seems to depend a lot on RNG. If you get lucky with a good harvest and a
plague in first couple years, it's smooth sailing to the end.

~~~
yock
Yeah, I got two plagues and was able to do extraordinarily well. Not sure my
subjects would entirely agree thought because, you know, plagues.

~~~
SeoxyS
Same here, two plagues and end up with a quarter the population I had earlier,
and yet apparently that's really good:

Hammurabi: I beg to report to you, In Year 11, 0 people starved, 3 people came
to the city. The city population is now 64 The city now owns 797 acres. You
harvested 4 bushels per acre. Rats ate 494 bushels.

In your 10-year term of office, 0 percent of the population starved per year
on average, .i.e., a total of 0 people died!! You started with 10 acres per
person and ended with 12.453125 acres per person

------
Camillo
People loved me when I let 2.5% die of starvation but ended up with almost 11
acres per person, and hated me when I kept every single person fed but ended
up with 8 acres per person.

~~~
simonh
The graveyard isn't a constituency with many votes.

~~~
automatthew
It was for LBJ.

------
lkrubner
I remember we had to play this game in high school, back in 1983. I had a
political science teacher who thought this was a very clever game. He was
fascinated with the primitive simulations that were available then. There was
another one where we had to manage a restaurant, buying ingredients and
selling meals. I did very well with that one. Funny how everything became a
lot more sophisticated within 10 years. 1983 was still the era of personal
computers that had 16 to 32 k.

~~~
kevin_thibedeau
Reminds me of the Lemonade stand BASIC game on Apple ][. It was trivial to
beat once I found out you could allocate negative funds to advertising and
your account would end up credited. Then the stand just became a front
operation laundering money through the print shop.

~~~
erikb
Although exploiting such kind of bugs is often reason to lose the fun in the
game I really love the idea of having a lemonade stand for money laundering
reasons because in the garage behind your stand you print money instead of ad
flyers.

------
wjkm
I really don't see how it can be seen as a favorable outcome (A fantastic
performance!!! Charlemagne, Disraeli and Jefferson combined could not have
done better!) when over a 10 year period, my population has dropped 62% and
the state has sold off 16% of its land just to feed its people. Obviously
that's not sustainable.

------
jgalt212
Yep, I first heard about Hammurabi in the book _Basic Computer Games_. Per the
wiki, it was the first computer book to sell a million copies.

[http://en.wikipedia.org/wiki/BASIC_Computer_Games](http://en.wikipedia.org/wiki/BASIC_Computer_Games)

------
code_duck
This game seems horribly buggy. It deducts bushels even when your move is
rejected ("Thank again!".) Currently I have -2 bushels, but I don't think the
concept of credit was intended to come into play.

~~~
ingler
I normally try to kill everyone off and sell everything off anyway but I
haven't noticed the bug you're experiencing.

~~~
code_duck
It disallows the move, but still deducts the resources. I don't have access to
a real computer at the moment, but I imagine the bug would be easy to identify
in the JavaScript.

------
liquidise
The randomization is VERY sever in this. On 5 new games, always doing 2000
food and 800 seeds, i get a Year 2 bushel total of: 748, 800, 1650, 2800,
4000.

That is a 536% swing in return for [seemingly] identical starting conditions.

------
pbewig
I translated to Scheme at my blog:
[http://programmingpraxis.com/2010/07/27/hamurabi-
bas/](http://programmingpraxis.com/2010/07/27/hamurabi-bas/).

------
brenfrow
I guess you do well if all your people die from the plague on year 10.

------
phreeza
I would like a game like this, except that you play a central bank.

------
DanBC
So, it now 404s which is a shame. I love these games. Does anyone know of a
collection anywhere? Ideally, something I can download?

~~~
Jtsummers
A playable version at archive.org [1]. And the Wikipedia page [2] has links to
source listings. Apparently there was a Dylan port, but that 404s for me as
well. And code listing for a BASIC version of it [3].

[1]
[https://archive.org/details/msdos_Hamurabi_1996](https://archive.org/details/msdos_Hamurabi_1996)

[2]
[http://en.wikipedia.org/wiki/Hamurabi](http://en.wikipedia.org/wiki/Hamurabi)

[3]
[http://www.dunnington.u-net.com/public/basicgames/HMRABI](http://www.dunnington.u-net.com/public/basicgames/HMRABI)

------
cakey
The best approach is to go all in buying and selling land when the prices
change. Ended with more population and more land per person.

------
graycat
It's discrete time stochastic dynamic programming problem.

------
eitland
I played this on a Tiki 100 back in the early nineties :)

------
hias
Would be cool if you could play longer than 10 years!

~~~
ingler
[http://www.apollowebworks.com/russell/samples/hamurabi.html](http://www.apollowebworks.com/russell/samples/hamurabi.html)

------
bebopsbraunbaer
aaand the server is down

------
desdiv
Minor typo: it currently says: "Hammurabi: Thank again." on invalid inputs
instead of "Hammurabi: Think again."

