-
Notifications
You must be signed in to change notification settings - Fork 0
/
Deck.py
31 lines (26 loc) · 936 Bytes
/
Deck.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
from random import shuffle, choice
class Deck(object):
CARD_DATA = (('Tempura',14),
('Sashimi',14),
('Dumpling',14),
('Maki 1', 6),
('Maki 2', 12),
('Maki 3', 8),
('Salmon Nigiri',10),
('Squid Nigiri',5),
('Egg Nigiri',5),
('Pudding',10),
('Wasabi',6),
('Chopsticks',4))
def __init__(self):
print ("Initializing Deck")
self.cards = []
for x in range(0,len(self.CARD_DATA)):
self.card_type = self.CARD_DATA[x]
print (self.card_type)
for y in range(0,self.card_type[1]):
self.cards.append(self.card_type[0])
print ("Total cards = "+ str(len(self.cards)))
shuffle(self.cards)
print (self.cards)
print ('\r\n\r\n')