-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (20 loc) · 688 Bytes
/
main.py
File metadata and controls
30 lines (20 loc) · 688 Bytes
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
import random
from collections import deque
from models import GameState, Player, BOT
def game_loop():
game_on = True
game_state = GameState()
human = Player()
human.profile.name = "Human"
game_state.players = deque([human])
game_state.players.extend([BOT() for _ in range(0, 3)])
while (game_on and game_state.number_of_cards < 11): # Rounds
game_state.deal()
game_state.place_bets()
for _ in range(0, game_state.number_of_cards):
game_state.play_trick()
game_state.compute_scores()
game_state.number_of_cards += 1
game_state.players.rotate(-1)
if __name__ == '__main__':
game_loop()