Hamurabi.bas.lua

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Hamurabi.bas.lua

Post by Inny »

For kicks, I ported an old Basic game to Lua. While it's not a Love game, specifically, I figured that some may get a moment of frustration out of it and was worth sharing here.

Hamurabi is a city management game, played in 10 rounds, where you decide how much land to buy and sell, how much food to give your people, and how much grain to plant for the next harvest. If you starve too many people, the game abruptly ends. After 10 rounds, you get scored according to how many people starved, and how much land the city owns.

Link: https://gist.github.com/inmatarian/5121902

Protip: Plagues are apparently a good thing, the original game rules don't factor in that number of deaths against your final scores.
Here was the version I ported: http://vintage-basic.net/bcg/hammurabi.bas
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Hamurabi.bas.lua

Post by Lafolie »

Hahaha, my first turn:

Code: Select all

HOW MANY ACRES DO YOU WISH TO BUY? 10
HOW MANY BUSHELS DO YOU WISH TO FEED YOUR PEOPLE? 100
HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED? 200
YOU STARVED 95 PEOPLE IN ONE YEAR!!!
DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY
BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT YOU HAVE
ALSO BEEN DECLARED NATIONAL FINK!!!!


PLAY AGAIN? 
This is very cool though. I've thought about making a text-based game before, I like the way this one works.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: Hamurabi.bas.lua

Post by scutheotaku »

Haha nice work!

Now we just need a LOVE version of DONKEY.BAS!
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Hamurabi.bas.lua

Post by Inny »

Lafolie wrote:YOU STARVED 95 PEOPLE IN ONE YEAR!!!
You totally need to feed your people more than that :P

Yeah, I'm on this kick right now where I'm seeking out old basic games to have a peek at the source code. It'd be totally cool to see a few ports of these games to Lua/Love.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests