Ghost in the Cell - Timeout

Am returning to Codingame after being away for awhile, and thought I would start back with Ghost in the Cell.

Have created some on the fundamentals needed to move forward in the competition, and have an implementation (able to win Wood 2, at least)… but something strange seems to be happening.

After capturing all the factories (and trying to print WAIT if no opponent factories exist) I lose… and the following error is printed:

“Timeout: the program did not provide 1 input lines in due time… Iaspartes will no longer be active in this game.”

Maybe I am missing something obvious here but the print statement does seem to be a little “touchy” on this one. For example, printing a singular WAIT without endline fails, but WAIT with endline has no issues. I know there have been some other “issues” so though I would reach out for a little help on this one.

Any advice or feedback would be appreciated, I’d love to obsess over this challenge some more!


Do end your lines with … an endline :slight_smile:

Yes I do… haha, but nice call. I was a little confused earlier.

This part of the message is interesting:
“…did not provide 1 input…”

However, I always print a WAIT command but as soon my cyborgs capture all the factories -> WAIT is not printed to standard output (instead the error message).

I did not see any WAIT command either in the standard output or standard error. It seems your code fails at this turn before reaching the part where you print your commands.

Thanks Thibaud… I resolved that issue.
It was a little strange because only on the very last round did my code fail to print to std out.

Now to figure out why I’m getting a timeout (only for some matches) on the very last round…