Skip to content

Commit 807f6b0

Browse files
authored
Merge pull request larymak#119 from willberg845/update-blackjack-readme
Update blackjack readme
2 parents 76b86c1 + 32edaca commit 807f6b0

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

BlackJackGame/BlackJackGame.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
dl = []
77

88
# Check Blackjack__________________________________________
9-
def BlackJack(s):
9+
def check_Twenty_One(s):
1010
if s==21:
1111
return True
1212
else:
@@ -68,8 +68,13 @@ def playersTurn(s):
6868

6969
s = check_sum(s)
7070

71-
if (BlackJack(s)):
72-
print("Hurray......It's a BLACKJACK....You Won\n")
71+
if (check_Twenty_One(s)):
72+
#Check Blackjack_______________________________________
73+
if len(pl) == 2:
74+
print("Hurray......It's a BLACKJACK....You Won\n")
75+
#Check if player made 21_______________________________
76+
else:
77+
print("Awesome!!!......You made 21!....You Won\n")
7378
return 2
7479
elif (Bust(s)):
7580
print("You got Bust.....You Lost\n")
@@ -123,8 +128,11 @@ def playersTurn(s):
123128
print(f"\nDealer's current hand: {dl}\n")
124129

125130
s = check_sum(s)
126-
if (BlackJack(s)):
127-
print("Dealer got a BlackJack and won the Game\nYou Lost\n")
131+
if (check_Twenty_One(s)):
132+
if len(dl) == 2:
133+
print("Dealer got a BlackJack and won the Game\nYou Lost\n")
134+
else:
135+
print("Dealer made 21 and won the Game\nBetter Luck Next Time!\n")
128136
break
129137
elif (Bust(s)):
130138
print("Dealer got Busted\nYou Won\n")

BlackJackGame/ReadMe.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Black Jack Game in Python
22

3-
A simple game of 21 made for Python
3+
A simplified game of 21 made for Python!
4+
5+
## Card Values
6+
Suits do not affect card values.
7+
8+
2 - 10 all are the same value as the card name.
9+
J, Q, and K are all worth 10.
10+
Aces: If adding 11 would make the score go over 21, then the ace is worth 1. Otherwise, it is worth 11.
11+
12+
## Gameplay
13+
Simply run the script to begin playing. The hand begins with both the player and dealer receiving two cards. The player only sees one of the dealer's cards at the start. The player goes first, choosing to Hit (Press 1) or Stay (Press 0). If the player recieves more than 21 points then they are Bust and have lost the hand. After the player selects Stay, it is then the dealers turn. The dealer Hits until they either receive a higher score than the player (player loses) or Bust (player wins).
14+
15+
## Blackjack
16+
A player gets a 'Blackjack' if they are dealt a card worth 10 and an Ace at the beginning of the hand. This automatically wins the game.
17+
18+
19+
**Note that for the purpose of this script is to allow the user to play a simple hand of Blackjack without some of the higher level parts of the game like betting or splitting doubles. All ties go to the player in this version of the game.
420

521
## Demo
622

0 commit comments

Comments
 (0)