- Created Wednesday, November 18th 2015 @ 09:46:48
I uploaded my first bot for four in a row and it passed the automatic tests on the upload, but if I try to launch a match it always times out. The languance is C.
I copied the log from the test match, compiled the bot on my machine (Windows 10, a very common pc) and fed it the instructions manually in the command line. This time it printed a properly formatted output instantly (in human time). Since the difference between "instantly" and "after 10 seconds" is huge, I take this as a sign that I'm using the wrong instruction to print the output and it's not recognized by the game engine.
Are instructions like the following correct for you?
printf("placedisc 4"); printf("placedisc %d", int);
Or I'm missing something, like "printf is not ok" or "add a specific character to mark the end of the instruction"?
DeveloperCreated Wednesday, November 18th 2015 @ 09:53:12
I think that should be fine. Maybe there is something with C that required your output to be done differently, but honestly I don't know very much about C. Maybe google will provide an answer, if not, let me know.
DeveloperUpdated Wednesday, November 18th 2015 @ 10:03:20
roccobarbi, by default printf doesn't add a newline at the end of your command. The engine keeps waiting for the newline, so that causes the timeout. Can you try using something like:
- Created Wednesday, November 18th 2015 @ 13:54:55
I added the newline, but it didn't solve the issue.
In the end, I solved it usinf fprintf() and fflush(), so the isse was probably caused by a buffered stdout.
fprintf(stdout,"place_disc %d\n", variable);
- Created Friday, December 9th 2016 @ 15:00:58
Thx for sharing roccobarbi, I had the same going on :-)