Hi !
I’m having a problem with the Great Escape, sometimes my input() retrieval never goes through the last wall.
I retrieve the input() for each playerCount, then I retrive wallCount and get input() for each wallCount.
And sometimes, when a wall has been added either by me or another player, I retrive all walls except for one, and the program stops due to timeout, I’m eliminated.
And I tired many things and can’t manage to understand when and why that happens, and what I could do about it.
Thanks !
This is my last input retrieval code in python3 :
inp=[]
for id in range(playerCount):
inp.append(input())
print("input=%s"%(inp[-1]), file=sys.stderr)
wallCount=int(input()) # number of walls on the board
print("input wallCount=%d"%(wallCount), file=sys.stderr)
for id in range(wallCount):
inp.append(input())
print("input=%s"%(inp[-1]), file=sys.stderr)
Ok, it turns out that it’s really a timeout.
At least I think it is.
But it does not happen there, I guess some stderr messages don’t go through, and the system kills our program not precisely when the timeout is occurring, or something like that.
I sped some things up, and it works.
It was the moment when the program was killed that was misleading, always when retrieving the last wall.
I encountered the same problem and thanks to you I understood what’s wrong. I think output is buffered and all output before next “input()” is not printed.
To print it you should use print(“something”, file=sys.stderr, flush=True)
Also there is larger limit on first turn, and I spent 0.5 seconds on first turn and failed on second turn, so I thought there was some error
In most of multiplayer games, first turn has a 1 second timeout and all other turns has a 50ms timeout. But The Great Escape is an old multiplayer puzzle so the other turns timeout is probably 100ms. It should be writter at the end of the statement.