-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
38 lines (31 loc) · 775 Bytes
/
app.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
import random
deck = []
colors = ['🔴', '🟡', '🟢', '🔵']
cards = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'Draw Two', 'Skip', 'Reverse']
wilds = ['Wild', 'Wild Draw Four']
"""
Generates the Uno cards.
"""
def generateDeck():
for color in colors:
for card in cards:
cardVal = '{} {}'.format(color, card)
deck.append(cardVal)
if card != 0:
if card != 'Draw Two':
if card != 'Skip':
if card != 'Reverse':
deck.append(cardVal)
for wild in wilds:
for i in range(2):
deck.append(wild)
def shuffleDeck():
random.shuffle(deck)
def display(deck):
for i in deck:
print(i)
generateDeck()
shuffleDeck()
print(deck)
# If you want to print the deck one-by-one, use display(deck).
# display(deck)