Judge for bot players in SeaWar with GUI on wxPython and with simple bot
sudo apt install wx3.0
python frame.pybot.py - simple bot for watch, how it works.
All commands must be sent by standart input/output.
Judge interface:
NB! All commands must be on the new line!
-
Print the name of the bot.
-
Print "OK". It'll show the judge, that the bot is ready.
-
Read a line. If it is "0" - you'll be first. If it's "1" - second.
-
If bot is 1st or if enemy "miss"ed - it must print a coordinate of his strike in "b4" format. Possible letters: "abcdefghij". Possible digits: "1 2 3 4 5 6 7 8 9 10".
-
Then it must read a line. "miss" means that you missed, "ou" means that you piped some enemy's ship and "kill" means that you killed it.
-
Read a line. If it is "nend" - game isn`t ended, "win" - you are a winner, "lose" - you are a loser. In case of "win"/"lose" bot may be terminated.
-
If you "ou"ed or "kill"ed enemy - repeat steps 4-7. Else go to step 8.
-
If bot is 2nd or it is "miss"ed, it must read a line. It is coordinates of enemy's strike in "b4" format.
-
You must print a string "miss"/"ou"/"kill" - according to enemy's strike.
-
Read a line. If it is "nend" - game isn`t ended, "win" - you are a winner, "lose" - you are a loser. In case of "win"/"lose" bot may be terminated.
-
If enemy's strike is "ou"/"kill" - repeat steps 8-11. Else go to step 4.