-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.py
More file actions
43 lines (32 loc) · 995 Bytes
/
player.py
File metadata and controls
43 lines (32 loc) · 995 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
31
32
33
34
35
36
37
38
39
40
41
42
43
import standard_hand
class Player():
player_id = 0
def __init__(self):
Player.player_id += 1
self.id = Player.player_id
self.hand = standard_hand.get_standard()
self.has_valid_moves = True
self.score = self.tally_score()
def decide_action(self, board):
pass
def tally_score(self):
self.score = 0
for p in self.hand:
self.score += p.get_value()
def get_soft_score(self):
score = 0
for p in self.hand:
score += p.get_soft_value()
return score
def remove_from_hand(self, bl_iter):
del self.hand[bl_iter]
def final_score(self):
print(f"Player {self.id} is out of moves!")
self.tally_score()
print(f"Final Score: {self.score}")
self.has_valid_moves = False
for p in self.hand:
for row in p.arr:
print(row)
print("--------------")
return