-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
63 lines (49 loc) · 1.75 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from action_cards import*
from players import *
from golem_cards import *
import random
from board import Board
from gameplay import*
def main():
players = players_list()
board = Board(players_list=players)
board.check_golem_board()
print(board.board_state())
last_round = []
while check_max_golems(players) != 5:
for player in players:
if check_max_golems(players) != 5:
print(f"\n<===== PLAYER {player.name}'s TURN ======>")
print(board.board_state())
print(player.check_player_status())
# Verifying Board state.
board.check_golem_board()
board.check_actions_board()
# Player takes their turn.
take_a_turn(board, player)
else:
for player in players:
if player.golems != 5:
last_round.append(player)
# A player has reached 5 golems - Remaining players gets 1 last turn.
for player in last_round:
print(player)
print(f"\n<===== PLAYER {player.name}'s TURN ======>")
print(board.board_state())
print(player.check_player_status())
# Verifying Board state.
board.check_golem_board()
board.check_actions_board()
# Player takes their turn.
take_a_turn(board, player)
# Counting up the player's points.
winner = {'name': None,
'points': 0}
for player in players:
if player.points > winner['points']:
winner['name'] = player.name
winner['points'] = player.points
print(
f"Congrats {winner['name']} on winning the game with {winner['points']} points!")
if __name__ == "__main__":
main()