map functions and exception fix

This commit is contained in:
Thefeli73 2020-10-03 20:06:28 +02:00
parent c5f8526740
commit 38451297a5

View File

@ -23,10 +23,12 @@ def main():
game_layer.start_game() game_layer.start_game()
# exit game after timeout # exit game after timeout
start_time = time.time() start_time = time.time()
chartMap()
optimizeAvailableTiles()
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: try:
take_turn() take_turn()
except: except Exception:
print(traceback.format_exc()) print(traceback.format_exc())
game_layer.end_game() game_layer.end_game()
exit() exit()
@ -135,6 +137,7 @@ def chartMap():
for y in range(len(state.map) - 1): for y in range(len(state.map) - 1):
if state.map[x][y] == 0: if state.map[x][y] == 0:
availableTiles.append((x, y)) availableTiles.append((x, y))
def optimizeAvailableTiles():
pass
if __name__ == "__main__": if __name__ == "__main__":
main() main()