Changeset 6.1.35


Ignore:
Timestamp:
08/20/2016 09:13:35 PM (8 years ago)
Author:
David Owen <dsowen@fugue88.ws>
branch-nick:
state
revision id:
dsowen@fugue88.ws-20160820211335-56x5uo7wks6bal0x
Message:

Moved captain to shared state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r6.1.34 r6.1.35  
    4141        self.player_count = player_count
    4242        self.mission = 0
     43        self.captain = 0
    4344
    4445
     
    8990    wins = 0
    9091    losses = 0
    91     captain = 0
    9292    team_failures = 0
    9393    team = None
    9494
    9595    def assemble_team():
    96         nonlocal captain, team, team_failures
     96        nonlocal team, team_failures
    9797
    98         print("Captain is {}".format(captain))
    99         team = players[captain].propose_team(state.team_size)
     98        print("Captain is {}".format(state.shared.captain))
     99        team = players[state.shared.captain].propose_team(state.team_size)
    100100        print("He proposed {}".format(team))
    101101
     
    112112            p.observe_team_vote(approved, votes)
    113113
    114         captain = (captain + 1) % state.shared.player_count
     114        state.shared.captain = (state.shared.captain + 1) % state.shared.player_count
    115115
    116116        if approved:
Note: See TracChangeset for help on using the changeset viewer.