From 342bdfdc64e0b7e1874e6e9280e1a2475cc6b8bb Mon Sep 17 00:00:00 2001 From: Peter Ward Date: Sat, 22 Feb 2014 20:22:46 +1100 Subject: initial version --- simple.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 simple.py (limited to 'simple.py') diff --git a/simple.py b/simple.py new file mode 100644 index 0000000..faeb366 --- /dev/null +++ b/simple.py @@ -0,0 +1,18 @@ +import random +import robots + +def bot(whoami, players, board): + my_robots = players[whoami]['robots'] + action = random.choice('UDLRP-') + return action * len(my_robots) + +if __name__ == '__main__': + random.seed(64) + map_ = robots.empty_map(20, 20, 4) + game = robots.Game(map_) + game.add_bot(bot, 'Alice') + game.add_bot(bot, 'Bob') + game.add_bot(bot, 'Charlie') + game.add_bot(bot, 'Doug') + viewer = robots.CursesViewer(game) + viewer.run() -- cgit v1.2.3