Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From new-branch-blackjack #666

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions projects/BlackJack/black_jack.py
Original file line number Diff line number Diff line change
@@ -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.
@@ -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
@@ -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(
@@ -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