blob: faeb3669f858990b8db4ad15f2909e4152877d6c (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()
|