-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdouble_or_nothing_game.py
58 lines (41 loc) · 1.17 KB
/
double_or_nothing_game.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
import double_or_nothing_util as dnUtil
class DoubleOrNothingGame:
def __init__(self):
self.resetGame()
def resetGame(self):
self.cardOne = None
self.cardTwo = None
self.deck = dnUtil.getNewDeck()
self.score = 1
self.highScore = 0
self.risk = 50
def incrementScore(self):
self.score *= 2
if self.score > self.highScore:
self.highScore = self.score
return self.score
def resetScore(self):
self.score = 1
return self.score
def resetDeck(self):
self.deck = dnUtil.getNewDeck()
def getCardOne(self):
return self.cardOne
def setCardOne(self, card):
self.cardOne = card
def getCardTwo(self):
return self.cardTwo
def setCardTwo(self, card):
self.cardTwo = card
def getGameDeck(self):
return self.deck
def getGameState(self):
return (self.cardOne, self.cardTwo, self.deck)
def getHighScore(self):
return self.highScore
def getRisk(self):
return self.risk
def setRisk(self, risk):
self.risk = risk
def getScore(self):
return self.score