Created
December 11, 2010 21:44
-
-
Save cflewis/737677 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StarcraftResourceGame extends EgyptModel { | |
val name = "Starcraft Resource Game" | |
def get_crystal = { | |
require(crystals > 0) | |
crystals-- | |
} | |
def get_gas = { | |
require(gas > 0) | |
gas-- | |
} | |
def crystal_rush = {Map(get_crystal -> 0.9, get_gas -> 0.1)} | |
def gas_rush = {Map(get_gas -> 0.9, gas_crystal -> 0.1)} | |
def random = {Map()} | |
def environment_model = {Map('gas -> 50, 'crystals -> 50))} | |
def interaction_model = { | |
rules([get_crystal, get_gas]) | |
end_system(crystals == 0 && gas == 0) | |
} | |
def user_model = { | |
users([crystal_rush, gas_rush, random]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment