File tree Expand file tree Collapse file tree 2 files changed +47
-174
lines changed Expand file tree Collapse file tree 2 files changed +47
-174
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 49
49
Question1 = input ("What's your first card?: " )
50
50
Question2 = input ("What's your second card?: " )
51
51
Question3 = input ("What's your third card?: " )
52
+ cardTotal = 0
53
+
54
+ while True :
55
+ if Question1 in Facecards :
56
+ cardTotal += int (Facecards [Question1 ])
57
+ print (f"Question1: { Question1 } " )
58
+
59
+ if Question2 in Facecards :
60
+ cardTotal += int (Facecards [Question2 ])
61
+ print (f"Question1: { Question2 } " )
62
+
63
+ if Question3 in Facecards :
64
+ cardTotal += int (Facecards [Question3 ])
65
+ print (f"Question1: { Question3 } " )
66
+ break
67
+ else :
68
+ print ("Not valid" )
69
+ break
70
+ else :
71
+ print ("Not valid" )
72
+ break
73
+ else :
74
+ print ("Not valid" )
75
+ break
76
+ if cardTotal < 17 :
77
+ print (f"Hit { cardTotal } " )
78
+ elif 17 <= cardTotal < 21 :
79
+ print (f"Stay { cardTotal } " )
80
+ elif cardTotal == 21 :
81
+ print (f"Backjack! { cardTotal } " )
82
+ elif cardTotal > 21 :
83
+ print (f"Already Busted { cardTotal } " )
84
+ else :
85
+ print ("Not Valid" )
52
86
53
- total = int (Question1 ) + int (Question2 ) + int (Question3 )
54
87
55
88
89
+ # print(cardTotal)
56
90
57
- if total < 17 :
58
- print ("Hit" )
59
- elif total <= 17 and total < 21 :
60
- print ("Stay" )
61
- elif total == 21 :
62
- print ("BlackJack!" )
63
- else :
64
- print ("Busted" )
91
+ # total = int(Question1) + int(Question2) + int(Question3)
92
+
93
+
94
+
95
+ # if total < 17:
96
+ # print("Hit")
97
+ # elif total <= 17 and total < 21:
98
+ # print("Stay")
99
+ # elif total == 21:
100
+ # print("BlackJack!")
101
+ # else:
102
+ # print("Busted")
65
103
66
104
67
105
You can’t perform that action at this time.
0 commit comments