Skip to content

Commit

Permalink
correction for initial troops + space before actions
Browse files Browse the repository at this point in the history
Correction for initial amount of troops in neutral factories (sometimes there were one more than the max) and correction such that spaces around ";" in player outputs doesn't make problems.
  • Loading branch information
Sylphen authored Mar 9, 2017
1 parent 0eeef9f commit 6ba5968
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engines/gitc.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def init():
if i == 1:
init_unit = random.randint(min_init_units, max_init_units)
else:
init_unit = random.randint(0, 5*prod_rate + 1)
init_unit = random.randint(0, 5*prod_rate)

factories[i].fid = i
factories[i].x = x
Expand Down Expand Up @@ -233,7 +233,7 @@ def end_game(ranking, tied=False):
def execute_orders(pid, actions):
global factories, bombs, troops

actions = actions.split(';')
actions = [action.strip() for action in actions.split(';')]
for i in range(len(actions)):
if actions[i].startswith('BOMB'):
actions[i] = '0_'+actions[i]
Expand Down

0 comments on commit 6ba5968

Please sign in to comment.