@@ -114,7 +114,7 @@ def check_ace(card):
114
114
115
115
BlackJack means 21. Whoever gets a total value of 21 with their cards immediately wins!
116
116
(winning through blackjack results in 3x the money)
117
- If the value of cards goes over 21, its called a BUST, which results in immediate loss...
117
+ If the value of cards goes over 21, it's called a BUST, which results in an immediate loss...
118
118
If both the players get the same value of cards , it's a TIE and the bet money is returned.
119
119
120
120
If none of the above cases are met ,the person with closer value to 21 wins.
@@ -138,6 +138,8 @@ def check_ace(card):
138
138
if bet > chips :
139
139
print ("You dont have enough chips." )
140
140
print ("Enter a valid amount. \n " )
141
+ elif bet <= 0 : #To prevent betting a negative value
142
+ print ("Invalid Bet" )
141
143
else :
142
144
chips -= bet
143
145
break
@@ -282,9 +284,12 @@ def check_ace(card):
282
284
break
283
285
284
286
else :
287
+
288
+
285
289
cont = input ("Do you want to continue? (y/n) :" )
290
+ check = cont .upper ()###So a capital or lowercase value can be entered
286
291
287
- if cont == "y " :
292
+ if check == "Y " :
288
293
print ("\n " * 100 )
289
294
290
295
print (
@@ -304,7 +309,9 @@ def check_ace(card):
304
309
print (input ("Press Enter to exit the terminal..." ))
305
310
break
306
311
312
+
313
+
307
314
except Exception as error :
308
315
print (f"Following error occurred : { error } \n Please try again." )
309
316
game_num -= 1 # round with error won't be counted
310
- continue
317
+ continue
0 commit comments