# download the engine
git clone http://github.com/dmangame/dmangame
cd dmangame/
# download more AIs, this will download AIs from
# dmangame's dmanai repository.
git clone http://github.com/dmangame/dmanai
grep -Rl AIClass * # Prints a list of files with AI in them
# no one will win this game.
python main.py --hl dmanai/basic/searchai.py ai/towerai.py
# make SearchAI win
vim dmanai/basic/searchai.py
# simpleai.py
AIClass="SimpleAI"
import logging
log = logging.getLogger(AIClass)
class SimpleAI(ai.AI):
def _init(self):
log.info("Initializing: Current Turn: %s",
self.current_turn)
def _spin(self):
log.info("My visible units:%s", self.my_units)
log.info("My visible enemies:%s", self.visible_enemies)
def _unit_died(self, unit):
log.info("%s died", unit)
def _unit_spawned(self, unit):
log.info("Received a new unit: %s", unit)
# register a user on github
# fork the dmanai repository
# play against any AI on github, using
python main.py <github_user>:username/ai.py
# In username/ai.py
class MyAI(ai.AI):
PLAY_IN_LADDER=True
...
def _spin(self):
pass
...
git add username/ai.py
git commit -m "Adding my AI to the ladder"
python main.py -r <github_user>:username/ai.py
http://dmangame.github.io/dmangame