Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 156ded3

Browse files
Update blackjack.py
1 parent 5b2b054 commit 156ded3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎Blackjack/blackjack.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33
import random
44

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-
105
playing = True
116

127

138
# CLASSES
149

1510
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')
1614

1715
def __init__(self, suit, rank):
1816
self.suit = suit
@@ -45,6 +43,9 @@ def deal(self): # pick out a card from the deck
4543

4644

4745
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}
4849

4950
def __init__(self):
5051
self.cards = []

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /