-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (24 loc) · 859 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from pandemic import Pandemic
import sys
# TODO: Allow user to choose how many players/epidemic cards.
NUM_PLAYERS, NUM_EPIDEMIC_CARDS = 2, 4
def play_game():
game = Pandemic(NUM_PLAYERS, NUM_EPIDEMIC_CARDS)
game.characters = game.create_characters()
game.set_up_board()
winner = None
while not winner:
for i in range(game.num_players):
print('Starting round {}'.format(game.round_number))
winner = game.take_player_turn(i)
if winner == 'Player':
print('Game over!\n', game)
print('Players have won!')
sys.exit(0)
if winner == 'Diseases':
print('Game over!\n', game)
print('Players have lost!')
sys.exit(0)
game.round_number += 1
if __name__ == "__main__":
play_game()