Changeset 3 for main.py


Ignore:
Timestamp:
08/16/2016 03:04:25 AM (8 years ago)
Author:
David Owen <dsowen@fugue88.ws>
branch-nick:
resistance
revision id:
dsowen@fugue88.ws-20160816030425-saoxb0jtwm36xc9y
Message:

Count failures to assemble a team towards a spy victory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r2 r3  
    153153    losses = 0
    154154    captain = 0
     155    team_failures = 0
    155156
    156157    for mission in range(1, 6):
     
    174175            captain = (captain + 1) % player_count
    175176            if approved:
     177                team_failures = 0
    176178                failures = 0
    177179                for i in team:
     
    203205                break
    204206            else:
    205                 pass
     207                team_failures += 1
     208                if team_failures == 5:
     209                    print("The spies won!")
     210                    for p in players:
     211                        p.observe_game(False)
     212                    return
    206213
    207214
Note: See TracChangeset for help on using the changeset viewer.