Merge remote-tracking branch 'origin/felix-lek' into linus
This commit is contained in:
commit
be9f53a6bb
17
main.py
17
main.py
@ -1,11 +1,12 @@
|
||||
import api
|
||||
# import api
|
||||
from game_layer import GameLayer
|
||||
|
||||
api_key = "74e3998d-ed3d-4d46-9ea8-6aab2efd8ae3" # TODO: Your api key here
|
||||
api_key = "74e3998d-ed3d-4d46-9ea8-6aab2efd8ae3"
|
||||
# The different map names can be found on considition.com/rules
|
||||
map_name = "training1" # TODO: You map choice here. If left empty, the map "training1" will be selected.
|
||||
|
||||
game_layer = GameLayer(api_key)
|
||||
useTestStrategy = False
|
||||
|
||||
|
||||
def main():
|
||||
@ -22,7 +23,19 @@ 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 useTestStrategy:
|
||||
state = game_layer.game_state
|
||||
|
||||
# messages and errors for console log
|
||||
for message in game_layer.game_state.messages:
|
||||
print(message)
|
||||
for error in game_layer.game_state.errors:
|
||||
print("Error: " + error)
|
||||
|
||||
# pre-made test strategy
|
||||
# which came with
|
||||
# starter kit
|
||||
if useTestStrategy:
|
||||
state = game_layer.game_state
|
||||
if len(state.residences) < 1:
|
||||
for i in range(len(state.map)):
|
||||
|
Reference in New Issue
Block a user