Skip to content

Commit

Permalink
Merge pull request #666 from Carl283583/new-branch-blackjack
Browse files Browse the repository at this point in the history
From new-branch-blackjack
  • Loading branch information
Mrinank-Bhowmick authored Dec 26, 2023
2 parents 1ede9ae + 1c115c7 commit c59bd9a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions projects/BlackJack/black_jack.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def check_ace(card):
BlackJack means 21. Whoever gets a total value of 21 with their cards immediately wins!
(winning through blackjack results in 3x the money)
If the value of cards goes over 21, its called a BUST, which results in immediate loss...
If the value of cards goes over 21, it's called a BUST, which results in an immediate loss...
If both the players get the same value of cards , it's a TIE and the bet money is returned.
If none of the above cases are met ,the person with closer value to 21 wins.
Expand All @@ -138,6 +138,8 @@ def check_ace(card):
if bet > chips:
print("You dont have enough chips.")
print("Enter a valid amount. \n")
elif bet <= 0: #To prevent betting a negative value
print("Invalid Bet")
else:
chips -= bet
break
Expand Down Expand Up @@ -282,9 +284,12 @@ def check_ace(card):
break

else:


cont = input("Do you want to continue? (y/n) :")
check= cont.upper()###So a capital or lowercase value can be entered

if cont == "y":
if check == "Y":
print("\n" * 100)

print(
Expand All @@ -304,7 +309,9 @@ def check_ace(card):
print(input("Press Enter to exit the terminal..."))
break



except Exception as error:
print(f"Following error occurred : {error} \nPlease try again.")
game_num -= 1 # round with error won't be counted
continue
continue

0 comments on commit c59bd9a

Please sign in to comment.