From 416a2d3aedbd0158a7c7e9485814fe6c2ddbcb20 Mon Sep 17 00:00:00 2001 From: Thefeli73 Date: Sat, 3 Oct 2020 19:31:09 +0200 Subject: [PATCH] take turn och global chartMap def --- main.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 91787a5..925feda 100644 --- a/main.py +++ b/main.py @@ -38,12 +38,12 @@ def main(): def take_turn(): - # TODO Implement your artificial intelligence here. - # TODO Take one action per turn until the game ends. - # TODO The following is a short example of how to use the StarterKit if not usePrebuiltStrategy: - state = game_layer.game_state - print("testrunda") + # TODO Implement your artificial intelligence here. + # TODO Take one action per turn until the game ends. + # TODO The following is a short example of how to use the StarterKit + + # messages and errors for console log for message in game_layer.game_state.messages: print(message) @@ -91,6 +91,12 @@ def take_turn(): for error in game_layer.game_state.errors: print("Error: " + error) +def chartMap(): + availableTiles = [] + for x in range(len(state.map) - 1): + for y in range(len(state.map) - 1): + if state.map[x][y] == 0: + availableTiles.append((x, y)) if __name__ == "__main__": main()