diff --git a/backend/static/bot/simple.py b/backend/static/bot/simple.py index 4c0e199..bea8c85 100644 --- a/backend/static/bot/simple.py +++ b/backend/static/bot/simple.py @@ -1,7 +1,7 @@ import sys, json, random -def move(command): - record = { 'moves': [command] } +def move(moves): + record = {'moves': moves} print(json.dumps(record)) sys.stdout.flush() @@ -13,12 +13,12 @@ for line in sys.stdin: other_planets = [p for p in state['planets'] if p['owner'] != 1] if not my_planets or not other_planets: - move(None) + move([]) else: planet = max(my_planets, key=lambda p: p['ship_count']) dest = min(other_planets, key=lambda p: p['ship_count']) - move({ + move([{ 'origin': planet['name'], 'destination': dest['name'], 'ship_count': planet['ship_count'] - 1 - }) + }]) diff --git a/backend/templates/help/help_1.html.tera b/backend/templates/help/help_1.html.tera index 79dd979..34d2e05 100644 --- a/backend/templates/help/help_1.html.tera +++ b/backend/templates/help/help_1.html.tera @@ -16,7 +16,7 @@ Information
$ wget mozaic.zeus.gent/bot/runner.py
$ wget mozaic.zeus.gent/bot/simple.py
-$ python runner.py -p 9142 --host mozaic.zeus.gent \
+$ python3 runner.py -p 9142 --host mozaic.zeus.gent \
-n <Your name> -i <Id from the lobby> \
- python simple.py
+ python3 simple.py
diff --git a/backend/templates/index2.html.tera b/backend/templates/index2.html.tera
index 55b771a..86339a1 100644
--- a/backend/templates/index2.html.tera
+++ b/backend/templates/index2.html.tera
@@ -54,7 +54,7 @@
Build a bot! All information about the planetwars game, please visit for input output format etc. You can find an example bot here.
Optionally, you can create your own custom with the mapbuilder
Start a game instance in the lobby, don't forget to name it, watching the visualization afterwars is the only way to know who won atm.
-Start up your bot and connect to the game instance. In the lobby you will see keys corresponding to players in the game. You can use the botrunner to run your bot, with the command python runner.py --host mozaic.zeus.gent -n {your name} -i {your key} {The command to start you bot}. +
Start up your bot and connect to the game instance. In the lobby you will see keys corresponding to players in the game. You can use the botrunner to run your bot, with the command python3 runner.py --host mozaic.zeus.gent -n {your name} -i {your key} {The command to start you bot}.
Invite friends!
Bash your friends because you have the superior bot, according to the visualizer
diff --git a/backend/templates/lobby.html.tera b/backend/templates/lobby.html.tera index ffab095..5e68a8e 100644 --- a/backend/templates/lobby.html.tera +++ b/backend/templates/lobby.html.tera @@ -22,7 +22,7 @@