Merge remote-tracking branch 'origin/felix-lek' into linus
This commit is contained in:
commit
deca6713fb
13
main.py
13
main.py
@ -12,6 +12,7 @@ api_key = "74e3998d-ed3d-4d46-9ea8-6aab2efd8ae3"
|
|||||||
map_name = "training1" # TODO: You map choice here. If left empty, the map "training1" will be selected.
|
map_name = "training1" # TODO: You map choice here. If left empty, the map "training1" will be selected.
|
||||||
|
|
||||||
game_layer = GameLayer(api_key)
|
game_layer = GameLayer(api_key)
|
||||||
|
state = game_layer.game_state
|
||||||
usePrebuiltStrategy = False
|
usePrebuiltStrategy = False
|
||||||
|
|
||||||
|
|
||||||
@ -76,12 +77,12 @@ def linus_take_turn():
|
|||||||
print("Error: " + error)
|
print("Error: " + error)
|
||||||
|
|
||||||
def take_turn():
|
def take_turn():
|
||||||
|
if not usePrebuiltStrategy:
|
||||||
# TODO Implement your artificial intelligence here.
|
# TODO Implement your artificial intelligence here.
|
||||||
# TODO Take one action per turn until the game ends.
|
# TODO Take one action per turn until the game ends.
|
||||||
# TODO The following is a short example of how to use the StarterKit
|
# TODO The following is a short example of how to use the StarterKit
|
||||||
if not usePrebuiltStrategy:
|
|
||||||
state = game_layer.game_state
|
|
||||||
print("testrunda")
|
|
||||||
# messages and errors for console log
|
# messages and errors for console log
|
||||||
for message in game_layer.game_state.messages:
|
for message in game_layer.game_state.messages:
|
||||||
print(message)
|
print(message)
|
||||||
@ -129,6 +130,12 @@ def take_turn():
|
|||||||
for error in game_layer.game_state.errors:
|
for error in game_layer.game_state.errors:
|
||||||
print("Error: " + error)
|
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__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Reference in New Issue
Block a user