-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
35 lines (29 loc) · 931 Bytes
/
constants.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
BJ_WIN = 21
BJ_DEALER_MAX = 17
BJ_FACE = 10
BJ_ACE_MIN = 1
BJ_ACE_MAX = 11
SUITS = [
'♠', '♥', '♦', '♣'
]
FACES = [
num + 2 for num in range(9)
] + ['A', 'J', 'K', 'Q']
class Outcome():
def __init__(self, WIN, LOSS, TIE, OTHER):
self.WIN = WIN
self.LOSS = LOSS
self.TIE = TIE
self.OTHER = OTHER
class Outcomes:
def __init__(self, outcome):
m = [{ 'message' : 'You win!', 'color': 0x4CAF50 },
{ 'message' : 'You lost ):', 'color': 0xE53935 },
{ 'message' : 'You tied.', 'color': 0xFFB300 },
{ 'message' : '', 'color': 0xFFB300 }]
self.outcome = (m[0] if outcome.WIN else m[1] if outcome.LOSS else m[2] if outcome.TIE else m[3])
class OutcomeResult:
def __init__(self, outcome: Outcome, reason: str, extra: str = None):
self.outcome = outcome
self.reason = reason
self.extra = extra