- Created Saturday, February 15th 2014 @ 02:36:08
I've been trying to make a bot in Python, but the best I got is a bot that compiles, returns values for the test case, but only null values in the test match. Could anyone help me out with a working starter bot? I feel I'm missing something obvious.
DeveloperCreated Saturday, February 15th 2014 @ 13:41:46
My Python bot is almost ready; I'll upload a trimmed down version as a starter bot on Monday.
- Updated Saturday, February 15th 2014 @ 14:16:41
Could you give me in indication of what's wrong with this bit of code? It works fine when I manually put test input through it, but it doesn't return anything on the website:
_ author _ = 'Arthelais'
def main(): while True: command = sys.stdin.readline() parts = command.split() if parts == 'pickstartingregions': print('No moves') elif parts == 'go': print('No moves')
if _ name _ == "_ main _": main()
DeveloperUpdated Tuesday, February 18th 2014 @ 15:28:01
I just looked through one of the logs your bot played. Your bot consistently outputted 'No moves', so the snippet you posted appears to be working.
Also, note that Python's print doesn't automatically flush. Which means all your commands will come one line late. To solve this you can use sys.stdout.flush().
parodyseCreated Tuesday, March 18th 2014 @ 14:33:57
Hey did you ever finish the Python starter? I would be interested in trying it out, too.
- Created Tuesday, March 18th 2014 @ 14:44:02
In the "Looking for Starterbots" thread Gurgeh shared this python bot, which can be used as a start: https://github.com/JackieXu/ConquestBot/