Hammurabi
Hammurabi is an old game, dating back to the time when computers were text-only. Nevertheless, it's reasonably fun and certainly challenging.
An old saw has it that "You can write a C program in any language." This version is translated fairly directly from a JavaScript program, so it's not coded in a very Ruby-like fashion; but it does work.
Here are the standard instructions for the game:
Congratulations, you are the newest ruler of ancient Samaria, elected for a ten year term of office. Your duties are to dispense food, direct farming, and buy and sell land as needed to support your people. Watch out for rat infestiations and the plague! Grain is the general currency, measured in bushels. The following will help you in your decisions:
- Each person needs at least 20 bushels of grain per year to survive
- Each person can farm at most 10 acres of land
- It takes 2 bushels of grain to farm an acre of land
- The market price for land fluctuates yearly
Rule wisely and you will be showered with appreciation at the end of your term. Rule poorly and you will be kicked out of office!
Due to some problems with pmWiki formatting, I can't list the program here; it's in a separate file, Hammurabi.rb.