The three rules of Ruby Q.:
Please do not post any solutions or spoiler discussion for this
quiz until 48 hours have elapsed from the time this message was
Support Ruby Q. by submitting ideas and responses
as often as you can.
Suggestion: A [QUIZ] in the subject of emails about the problem
helps everyone on Ruby T. follow the discussion. Please reply to
the original quiz message, if you can.
RSS Feed: http://rubyquiz.strd6.com/quizzes.rss
This week’s quiz was submitted by Martin DeMello1
Back in the microcomputer age, there was a fascinating little game
called Hamurabi (no, that isn’t a typo - there was an eight character
limit). The game mechanics were pretty simple: you were the ruler of a
kingdom, and every year you had to decide what proportion of your
grain to allocate to planting, and what proportion to feeding the
people. The game engine would then set up the formulae, toss in a few
random numbers and simulate your crop and population growth. For all
its simplicity, though, it was a lot of fun to play, and oddly
The Wikipedia page2 links to a couple of implementations in BASIC;
pick one and reimplement it in Ruby.
Extra credit: if someone can come up with a fun multiplayer version,
I’ll be impressed