-
Notifications
You must be signed in to change notification settings - Fork 0
/
deck.py
43 lines (37 loc) · 1.32 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
class deck:
def __init__(self):
self.maze = []
for x in range(1,5):
if x == 1:
suit = "spades"
if x == 2:
suit = "hearts"
if x == 3:
suit = "clubs"
if x == 4:
suit = "diamonds"
self.maze = self.maze + [("ace",suit)]
self.maze = self.maze + [("two",suit)]
self.maze = self.maze + [("three",suit)]
self.maze = self.maze + [("four",suit)]
self.maze = self.maze + [("five",suit)]
self.maze = self.maze + [("six",suit)]
self.maze = self.maze + [("seven",suit)]
self.maze = self.maze + [("eight",suit)]
self.maze = self.maze + [("nine",suit)]
self.maze = self.maze + [("ten",suit)]
self.maze = self.maze + [("jack",suit)]
self.maze = self.maze + [("queen",suit)]
self.maze = self.maze + [("king",suit)]
def Print(self):
print(self.maze)
def deal(self):
import card
mycard = self.maze.pop(0)
name = mycard[0]
suit = mycard[1]
mycard = card.card(name, suit)
return mycard
def shuffle(self):
import random
random.shuffle(self.maze)