Merge remote-tracking branch 'origin/felix-lek' into linus

This commit is contained in:
linhara 2020-10-03 17:52:02 +02:00
commit 1fe1b01e78

View File

@ -1,5 +1,6 @@
# import api # import api
import time import time
import sys
from sys import exit from sys import exit
from game_layer import GameLayer from game_layer import GameLayer
@ -19,9 +20,15 @@ def main():
# exit game after timeout # exit game after timeout
start_time = time.time() start_time = time.time()
while game_layer.game_state.turn < game_layer.game_state.max_turns: while game_layer.game_state.turn < game_layer.game_state.max_turns:
try:
take_turn() take_turn()
except:
e = sys.exc_info()[0]
print(e)
game_layer.end_game()
exit()
time_diff = time.time() - start_time time_diff = time.time() - start_time
if time_diff > 5: if time_diff > 40:
game_layer.end_game() game_layer.end_game()
exit() exit()
print("Done with game: " + game_layer.game_state.game_id) print("Done with game: " + game_layer.game_state.game_id)