Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,14 +54,8 @@ def start_game():
|
|
| 54 |
game_play = GamePlay(player, dealer, game_deck, blackjack_multiplier)
|
| 55 |
return game_deck, dealer, player, game_play
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
game_deck, dealer, player, game_play = start_game()
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
st.title('🃏Blackjack Simulator AI♠2️⃣1️⃣')
|
| 66 |
|
| 67 |
if st.button('New hand?'):
|
|
@@ -76,18 +70,19 @@ dealer_stats = st.empty()
|
|
| 76 |
dealer_images = st.empty()
|
| 77 |
result = st.empty()
|
| 78 |
|
| 79 |
-
|
| 80 |
if 'Hit' in player.possible_actions:
|
| 81 |
if player_hit_option.button('Hit'):
|
| 82 |
player.player_hit(game_deck, game_play)
|
| 83 |
if 'Hit' not in player.possible_actions:
|
| 84 |
player_hit_option.empty()
|
|
|
|
| 85 |
if 'Double Down' in player.possible_actions:
|
| 86 |
if player_double_down_option.button('Double Down'):
|
| 87 |
player.double_down(game_deck, game_play)
|
| 88 |
player_double_down_option.empty()
|
| 89 |
player_hit_option.empty()
|
| 90 |
player_stand_option.empty()
|
|
|
|
| 91 |
if 'Stand' in player.possible_actions:
|
| 92 |
if player_stand_option.button('Stand'):
|
| 93 |
player.stand(game_play)
|
|
@@ -95,7 +90,6 @@ if 'Stand' in player.possible_actions:
|
|
| 95 |
player_double_down_option.empty()
|
| 96 |
player_stand_option.empty()
|
| 97 |
|
| 98 |
-
|
| 99 |
game_play.update()
|
| 100 |
player_stats.write(player)
|
| 101 |
player_images.image([Image.open(card.image_location)
|
|
|
|
| 54 |
game_play = GamePlay(player, dealer, game_deck, blackjack_multiplier)
|
| 55 |
return game_deck, dealer, player, game_play
|
| 56 |
|
|
|
|
|
|
|
|
|
|
| 57 |
game_deck, dealer, player, game_play = start_game()
|
| 58 |
|
|
|
|
|
|
|
|
|
|
| 59 |
st.title('🃏Blackjack Simulator AI♠2️⃣1️⃣')
|
| 60 |
|
| 61 |
if st.button('New hand?'):
|
|
|
|
| 70 |
dealer_images = st.empty()
|
| 71 |
result = st.empty()
|
| 72 |
|
|
|
|
| 73 |
if 'Hit' in player.possible_actions:
|
| 74 |
if player_hit_option.button('Hit'):
|
| 75 |
player.player_hit(game_deck, game_play)
|
| 76 |
if 'Hit' not in player.possible_actions:
|
| 77 |
player_hit_option.empty()
|
| 78 |
+
|
| 79 |
if 'Double Down' in player.possible_actions:
|
| 80 |
if player_double_down_option.button('Double Down'):
|
| 81 |
player.double_down(game_deck, game_play)
|
| 82 |
player_double_down_option.empty()
|
| 83 |
player_hit_option.empty()
|
| 84 |
player_stand_option.empty()
|
| 85 |
+
|
| 86 |
if 'Stand' in player.possible_actions:
|
| 87 |
if player_stand_option.button('Stand'):
|
| 88 |
player.stand(game_play)
|
|
|
|
| 90 |
player_double_down_option.empty()
|
| 91 |
player_stand_option.empty()
|
| 92 |
|
|
|
|
| 93 |
game_play.update()
|
| 94 |
player_stats.write(player)
|
| 95 |
player_images.image([Image.open(card.image_location)
|