Skip to content

Commit 77af911

Browse files
authored
Update main.py
1 parent ca44b01 commit 77af911

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

main.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import random
22

33
class Card(object):
4-
def __init__(self, name, value, suit):
4+
def __init__(self, name, value, suit, symbol):
55
self.value = value
66
self.suit = suit
77
self.name = name
8+
self.symbol = symbol
89
self.showing = False
910
def __repr__(self):
1011
if self.showing:
11-
return str(self.name) + " of " + self.suit
12+
return self.symbol
1213
else:
1314
return "Card"
1415

@@ -23,7 +24,7 @@ def deal(self):
2324
class StandardDeck(object):
2425
def __init__(self):
2526
self.cards = []
26-
suits = ["Hearts", "Spades", "Diamonds", "Clubs"]
27+
suits = {"Hearts":"♡", "Spades":"♠", "Diamonds":"♢", "Clubs":"♣"}
2728
values = {"Two":2,
2829
"Three":3,
2930
"Four":4,
@@ -39,7 +40,12 @@ def __init__(self):
3940
"Ace":14}
4041
for name in values:
4142
for suit in suits:
42-
self.cards.append(Card(name, values[name], suit))
43+
symbolIcon = suits[suit]
44+
if values[name] < 11:
45+
symbol = str(values[name])+symbolIcon
46+
else:
47+
symbol = name[0] + symbolIcon
48+
self.cards.append(Card(name, values[name], suit, symbol))
4349

4450
def __repr__(self):
4551
return "Standard deck of cards:{0} cards remaining".format(len(self.cards))
@@ -102,7 +108,7 @@ def highCard(self):
102108
highCard = card
103109
return highCard
104110

105-
def interpreterVideoPoker():
111+
def Poker():
106112
player = Player()
107113

108114
# initial amount

0 commit comments

Comments
 (0)