diff options
Diffstat (limited to 'web/pw-server/src/routes/docs/rules.md')
-rw-r--r-- | web/pw-server/src/routes/docs/rules.md | 92 |
1 files changed, 47 insertions, 45 deletions
diff --git a/web/pw-server/src/routes/docs/rules.md b/web/pw-server/src/routes/docs/rules.md index 45a72c7..ff803e7 100644 --- a/web/pw-server/src/routes/docs/rules.md +++ b/web/pw-server/src/routes/docs/rules.md @@ -1,5 +1,5 @@ - ## How to play + In every game turn, your bot will receive a json-encoded line on stdin, describing the current state of the game. Each state will hold a set of planets, and a set of spaceship fleets traveling between the planets (_expeditions_). @@ -7,41 +7,41 @@ traveling between the planets (_expeditions_). Example game state: ```json - { - "planets": [ - { - "ship_count": 2, - "x": -2.0, - "y": 0.0, - "owner": 1, - "name": "your planet" - }, - { - "ship_count": 4, - "x": 2.0, - "y": 0.0, - "owner": 2, - "name": "enemy planet" - }, - { - "ship_count": 2, - "x": 0.0, - "y": 2.0, - "owner": null, - "name": "neutral planet" - } - ], - "expeditions": [ - { - "id": 169, - "ship_count": 8, - "origin": "your planet", - "destination": "enemy planet", - "owner": 1, - "turns_remaining": 2 - } - ] - } +{ + "planets": [ + { + "ship_count": 2, + "x": -2.0, + "y": 0.0, + "owner": 1, + "name": "your planet" + }, + { + "ship_count": 4, + "x": 2.0, + "y": 0.0, + "owner": 2, + "name": "enemy planet" + }, + { + "ship_count": 2, + "x": 0.0, + "y": 2.0, + "owner": null, + "name": "neutral planet" + } + ], + "expeditions": [ + { + "id": 169, + "ship_count": 8, + "origin": "your planet", + "destination": "enemy planet", + "owner": 1, + "turns_remaining": 2 + } + ] +} ``` The `owner` field holds a player number when the planet is held by a player, and is @@ -53,16 +53,17 @@ Every turn, you may send out expeditions to conquer other planets. You can do th a json-encoded line to stdout: Example command: + ```json - { - "moves": [ - { - "origin": "your planet", - "destination": "enemy planet", - "ship_count": 2 - } - ] - } +{ + "moves": [ + { + "origin": "your planet", + "destination": "enemy planet", + "ship_count": 2 + } + ] +} ``` All players send out their commands simultaneously, so there is no turn order. You may send as @@ -81,5 +82,6 @@ You can code your bot in python 3.10. You have the entire stdlib at your disposa If you'd like additional libraries or a different programming language, feel free to nag the administrator. ### TL;DR + Head over to the editor view to get started - a working example is provided. Feel free to just hit the play button to see how it works! |