Skip to content

Commit 042819c

Browse files
Will BergWill Berg
Will Berg
authored and
Will Berg
committed
Update Blackjack Condition
1 parent fdb6825 commit 042819c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
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")

0 commit comments

Comments
 (0)