|
2 | 2 |
|
3 | 3 | import random
|
4 | 4 |
|
5 | | -suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs') |
6 | | -ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace') |
7 | | -values = {'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5, 'Six': 6, 'Seven': 7, 'Eight': 8, |
8 | | - 'Nine': 9, 'Ten': 10, 'Jack': 10, 'Queen': 10, 'King': 10, 'Ace': 11} |
9 | | - |
10 | 5 | playing = True
|
11 | 6 |
|
12 | 7 |
|
13 | 8 | # CLASSES
|
14 | 9 |
|
15 | 10 | class Card: # Creates all the cards
|
| 11 | + |
| 12 | + suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs') |
| 13 | + ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace') |
16 | 14 |
|
17 | 15 | def __init__(self, suit, rank):
|
18 | 16 | self.suit = suit
|
@@ -45,6 +43,9 @@ def deal(self): # pick out a card from the deck
|
45 | 43 |
|
46 | 44 |
|
47 | 45 | class Hand: # show all the cards that the dealer and player have
|
| 46 | + |
| 47 | + values = {'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5, 'Six': 6, 'Seven': 7, 'Eight': 8, |
| 48 | + 'Nine': 9, 'Ten': 10, 'Jack': 10, 'Queen': 10, 'King': 10, 'Ace': 11} |
48 | 49 |
|
49 | 50 | def __init__(self):
|
50 | 51 | self.cards = []
|
|
0 commit comments