add types

This commit is contained in:
ajuvercr 2019-09-16 21:18:35 +02:00
parent c846042597
commit cd3e42beaa
5 changed files with 125 additions and 0 deletions

23
client/bot7.txt Normal file
View file

@ -0,0 +1,23 @@
start{"planets":[{"ship_count":7,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":6,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":7,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":6,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":0,"ship_count":6,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":5},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":10}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":6,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":0,"ship_count":6,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":4},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":9},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":11},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":11}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":6,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":0,"ship_count":6,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":3},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":8},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":10},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":10},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":11},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":11}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":6,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":0,"ship_count":6,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":2},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":7},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":9},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":9},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":10},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":10},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":11},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":11}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":6,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":0,"ship_count":6,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":1},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":6},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":8},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":8},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":9},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":9},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":10},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":10},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":11},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":11}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":0,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":11},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":5},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":7},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":7},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":8},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":8},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":9},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":9},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":10},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":10},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":11}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":0,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":10},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":4},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":6},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":6},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":7},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":7},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":8},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":8},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":9},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":9},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":10},{"id":12,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":5},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":10}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":0,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":9},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":3},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":5},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":5},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":6},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":6},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":7},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":7},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":8},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":8},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":9},{"id":12,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":4},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":9},{"id":14,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":5},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":10}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":0,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":8},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":2},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":4},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":4},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":5},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":5},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":6},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":6},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":7},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":7},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":8},{"id":12,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":3},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":8},{"id":14,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":4},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":9},{"id":16,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":5},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":10}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":0,"x":-3.0,"y":5.0,"owner":null,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":7},{"id":1,"ship_count":6,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":1},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":3},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":3},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":4},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":4},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":5},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":5},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":6},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":6},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":7},{"id":12,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":2},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":7},{"id":14,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":3},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":8},{"id":16,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":4},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":9},{"id":18,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":5},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":10}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":6,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":6},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":10},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":2},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":2},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":3},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":3},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":4},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":4},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":5},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":5},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":6},{"id":12,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":1},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":6},{"id":14,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":2},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":7},{"id":16,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":3},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":8},{"id":18,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":4},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":9},{"id":20,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":5}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":1,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":3,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":5},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":9},{"id":2,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":1},{"id":3,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":1},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":2},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":2},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":3},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":3},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":4},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":4},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":5},{"id":23,"ship_count":5,"origin":"duteros","destination":"protos","owner":1,"turns_remaining":5},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":5},{"id":14,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":1},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":6},{"id":16,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":2},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":7},{"id":18,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":3},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":8},{"id":20,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":4},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":11}]}
{"planets":[{"ship_count":1,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":1,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":1,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":4},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":8},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":11},{"id":24,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":5},{"id":4,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":1},{"id":5,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":1},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":2},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":2},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":3},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":3},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":4},{"id":23,"ship_count":5,"origin":"duteros","destination":"protos","owner":1,"turns_remaining":4},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":4},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":10},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":5},{"id":16,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":1},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":6},{"id":18,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":2},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":7},{"id":20,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":3}]}
{"planets":[{"ship_count":1,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":1,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":1,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":3},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":7},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":10},{"id":24,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":4},{"id":20,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":2},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":6},{"id":6,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":1},{"id":7,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":1},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":2},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":2},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":3},{"id":23,"ship_count":5,"origin":"duteros","destination":"protos","owner":1,"turns_remaining":3},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":3},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":9},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":4},{"id":18,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":1},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":5}]}
{"planets":[{"ship_count":1,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":1,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":1,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":2},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":6},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":9},{"id":24,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":3},{"id":20,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":1},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":5},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":4},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":3},{"id":8,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":1},{"id":9,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":1},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":2},{"id":23,"ship_count":5,"origin":"duteros","destination":"protos","owner":1,"turns_remaining":2},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":2},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":8}]}
{"planets":[{"ship_count":1,"x":-6.0,"y":0.0,"owner":2,"name":"protos"},{"ship_count":1,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":1,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":11,"ship_count":1,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":1},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":5},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":8},{"id":24,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":2},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":7},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":4},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":3},{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":2},{"id":13,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":1},{"id":23,"ship_count":5,"origin":"duteros","destination":"protos","owner":1,"turns_remaining":1},{"id":10,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":1}]}
{"planets":[{"ship_count":4,"x":-6.0,"y":0.0,"owner":1,"name":"protos"},{"ship_count":3,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":1,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":15,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":1},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":4},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":7},{"id":24,"ship_count":1,"origin":"protos","destination":"duteros","owner":2,"turns_remaining":1},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":6},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":3},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":2}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":1,"name":"protos"},{"ship_count":4,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":26,"ship_count":3,"origin":"protos","destination":"tritos","owner":1,"turns_remaining":10},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":3},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":6},{"id":17,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":1},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":5},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":2}]}
{"planets":[{"ship_count":3,"x":-6.0,"y":0.0,"owner":1,"name":"protos"},{"ship_count":3,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":3,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":26,"ship_count":3,"origin":"protos","destination":"tritos","owner":1,"turns_remaining":9},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":2},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":5},{"id":27,"ship_count":3,"origin":"duteros","destination":"tritos","owner":1,"turns_remaining":5},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":4},{"id":19,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":1}]}
{"planets":[{"ship_count":2,"x":-6.0,"y":0.0,"owner":1,"name":"protos"},{"ship_count":5,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":4,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":26,"ship_count":3,"origin":"protos","destination":"tritos","owner":1,"turns_remaining":8},{"id":21,"ship_count":1,"origin":"tetartos","destination":"duteros","owner":1,"turns_remaining":1},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":4},{"id":27,"ship_count":3,"origin":"duteros","destination":"tritos","owner":1,"turns_remaining":4},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":3},{"id":28,"ship_count":2,"origin":"protos","destination":"tritos","owner":1,"turns_remaining":10}]}
{"planets":[{"ship_count":3,"x":-6.0,"y":0.0,"owner":1,"name":"protos"},{"ship_count":3,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":5,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":26,"ship_count":3,"origin":"protos","destination":"tritos","owner":1,"turns_remaining":7},{"id":29,"ship_count":4,"origin":"duteros","destination":"tritos","owner":1,"turns_remaining":5},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":3},{"id":27,"ship_count":3,"origin":"duteros","destination":"tritos","owner":1,"turns_remaining":3},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":2},{"id":28,"ship_count":2,"origin":"protos","destination":"tritos","owner":1,"turns_remaining":9}]}
{"planets":[{"ship_count":4,"x":-6.0,"y":0.0,"owner":1,"name":"protos"},{"ship_count":4,"x":-3.0,"y":5.0,"owner":1,"name":"duteros"},{"ship_count":6,"x":3.0,"y":5.0,"owner":null,"name":"tritos"},{"ship_count":2,"x":6.0,"y":0.0,"owner":1,"name":"tetartos"},{"ship_count":6,"x":3.0,"y":-5.0,"owner":null,"name":"pemptos"},{"ship_count":6,"x":-3.0,"y":-5.0,"owner":null,"name":"extos"}],"expeditions":[{"id":26,"ship_count":3,"origin":"protos","destination":"tritos","owner":1,"turns_remaining":6},{"id":29,"ship_count":4,"origin":"duteros","destination":"tritos","owner":1,"turns_remaining":4},{"id":25,"ship_count":2,"origin":"tetartos","destination":"protos","owner":1,"turns_remaining":2},{"id":27,"ship_count":3,"origin":"duteros","destination":"tritos","owner":1,"turns_remaining":2},{"id":22,"ship_count":1,"origin":"protos","destination":"tetartos","owner":2,"turns_remaining":1},{"id":28,"ship_count":2,"origin":"protos","destination":"tritos","owner":1,"turns_remaining":8},{"id":30,"ship_count":4,"origin":"tetartos","destination":"tritos","owner":1,"turns_remaining":5}]}

0
client/log.log Normal file
View file

4
client/run.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
rm bot*.txt
cargo run $1 python simple.py

29
client/simple.py Normal file
View file

@ -0,0 +1,29 @@
import sys, json, random
def move(command):
record = { 'moves': [command] }
print(json.dumps(record))
sys.stdout.flush()
f_name = f"bot{random.randint(0, 10)}.txt"
f = open(f_name,"w+")
f.write("start")
f.flush()
for line in sys.stdin:
f.write(line)
f.flush()
state = json.loads(line)
# find planet with most ships
my_planets = [p for p in state['planets'] if p['owner'] == 1]
other_planets = [p for p in state['planets'] if p['owner'] != 1]
if not my_planets or not other_planets:
move(None)
else:
planet = max(my_planets, key=lambda p: p['ship_count'])
dest = min(other_planets, key=lambda p: p['ship_count'])
move({
'origin': planet['name'],
'destination': dest['name'],
'ship_count': planet['ship_count'] - 1
})

69
client/src/types.rs Normal file
View file

@ -0,0 +1,69 @@
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[serde(tag = "type", content = "content")]
pub enum ServerMessage {
/// Game state in current turn
GameState(State),
/// The action that was performed
PlayerAction(PlayerAction),
/// The game is over, and this is the concluding state.
FinalState(State),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[serde(tag = "type", content = "value")]
pub enum PlayerAction {
Timeout,
ParseError(String),
Commands(Vec<PlayerCommand>),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PlayerCommand {
pub command: Command,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<CommandError>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum CommandError {
NotEnoughShips,
OriginNotOwned,
ZeroShipMove,
OriginDoesNotExist,
DestinationDoesNotExist,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Command {
pub origin: String,
pub destination: String,
pub ship_count: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct State {
pub planets: Vec<Planet>,
pub expeditions: Vec<Expedition>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Expedition {
pub id: u64,
pub ship_count: u64,
pub origin: String,
pub destination: String,
pub owner: usize,
pub turns_remaining: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Planet {
pub ship_count: u64,
pub x: f64,
pub y: f64,
pub owner: Option<usize>,
pub name: String,
}