optimize fun
This commit is contained in:
parent
6aa69eb842
commit
942dc02331
6
main.py
6
main.py
@ -28,7 +28,6 @@ def main():
|
|||||||
# exit game after timeout
|
# exit game after timeout
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
chartMap()
|
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()
|
||||||
@ -90,7 +89,6 @@ def take_turn():
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
develop_society()
|
develop_society()
|
||||||
|
|
||||||
# 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)
|
||||||
@ -141,14 +139,14 @@ def take_turn():
|
|||||||
|
|
||||||
def chartMap():
|
def chartMap():
|
||||||
state = game_layer.game_state
|
state = game_layer.game_state
|
||||||
availableTiles = []
|
|
||||||
for x in range(len(state.map) - 1):
|
for x in range(len(state.map) - 1):
|
||||||
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))
|
||||||
|
optimizeAvailableTiles()
|
||||||
|
|
||||||
def optimizeAvailableTiles():
|
def optimizeAvailableTiles():
|
||||||
|
#hitta #utilities antal bästa platser i mitten av smeten och sätt de först, sätt allt runt dem i ordning så närmast är längst fram i listan
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user