Changeset 6.1.37 for main.py


Ignore:
Timestamp:
08/20/2016 09:18:55 PM (8 years ago)
Author:
David Owen <dsowen@fugue88.ws>
branch-nick:
state
revision id:
dsowen@fugue88.ws-20160820211855-9ulqlhxl8w3d8poe
Message:

Moved team_failures to shared state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r6.1.36 r6.1.37  
    4242        self.mission = 0
    4343        self.captain = 0
     44        self.team_failures = 0
    4445
    4546
     
    9192    wins = 0
    9293    losses = 0
    93     team_failures = 0
    9494
    9595    def assemble_team():
    96         nonlocal team_failures
    97 
    9896        print("Captain is {}".format(state.shared.captain))
    9997        team = players[state.shared.captain].propose_team(state.team_size)
     
    115113
    116114        if approved:
    117             team_failures = 0
     115            state.shared.team_failures = 0
    118116            return PerformMission(shared, team)
    119117        else:
    120             team_failures += 1
     118            state.shared.team_failures += 1
    121119            return AssembleTeam(shared, state.team_size)
    122120
     
    154152            state = perform_mission()
    155153
    156         if team_failures == 5:
     154        if shared.team_failures == 5:
    157155            print("The spies won!")
    158156            for p in players:
Note: See TracChangeset for help on using the changeset viewer.