summaryrefslogtreecommitdiff
path: root/simple.py
diff options
context:
space:
mode:
Diffstat (limited to 'simple.py')
-rw-r--r--simple.py18
1 files changed, 18 insertions, 0 deletions
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()