summaryrefslogtreecommitdiff
path: root/simple.py
diff options
context:
space:
mode:
authorPeter Ward <peteraward@gmail.com>2014-04-05 15:35:41 +1100
committerPeter Ward <peteraward@gmail.com>2014-04-05 15:35:41 +1100
commitaa86046a411409a41c95493e9913759146515613 (patch)
tree70bcb9ba4dac8fdafc204084451d71b381824016 /simple.py
parentf8a9f2b824f0fbbb1e1e9d4a58659a513c8bbe78 (diff)
playing around with things
Diffstat (limited to 'simple.py')
-rw-r--r--simple.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/simple.py b/simple.py
index 78d4a7c..932cc09 100644
--- a/simple.py
+++ b/simple.py
@@ -25,6 +25,7 @@ def paths_to_enemies(enemies, board, iterations=None):
if iterations is None:
iterations = 10
+ iterations = width * height
distances = []
for y in range(height):
@@ -105,18 +106,26 @@ def never_paint(whoami, players, board):
def bot(whoami, players, board):
my_robots = players[whoami]['robots']
return ''.join(
- random.choice('ULDRPP')
+ random.choice('ULDRP-')
for _ in range(len(my_robots))
)
if __name__ == '__main__':
# random.seed(42)
- map_ = robots.border_map(30, 10, 4)
+ map_ = robots.border_map(30, 10, 0)
+ for y in range(8):
+ map_[y][10] = '*'
+ for y in range(11, 2, -1):
+ map_[y][20] = '*'
+ map_[5][5] = '1'
+ map_[5][15] = '2'
+ map_[5][25] = '3'
game = robots.Game(map_)
- game.add_bot(attacker, 'Alice')
- game.add_bot(attacker, 'Adam')
- game.add_bot(bot, 'Barry')
- game.add_bot(bot, 'Bob')
+# game.add_bot(attacker, 'Alice')
+# game.add_bot(attacker, 'Adam')
+ game.add_bot(attacker, 'Barry')
+ game.add_bot(attacker, 'Bob')
+ game.add_bot(never_paint, 'Baldrick')
viewer = robots.CursesViewer(game)
viewer.run()