Skip to content

Commit 16f6922

Browse files
committed
update main from remote, check money on respin without changing bet
1 parent 440467e commit 16f6922

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

casino/games/slots/slots.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
SEC_BTWN_SPIN = 0.1
2727
TOTAL_SPINS = 10
28-
WIN_PROB = 0.3
29-
HI_VAL_PROB = 0.1
28+
WIN_PROB = 0.2
29+
HI_VAL_PROB = 0.05
3030

3131
# Currently 1 pay line, goal is to have several and:
3232
# - implement pattern patching for wins across lines
@@ -39,11 +39,10 @@ def play_slots(account) -> None:
3939
while True:
4040
clear_screen()
4141
display_topbar(account, **HEADER_OPTIONS)
42-
if take_new_bet:
42+
if take_new_bet or bet_amount > account.balance:
4343
bet_amount = get_bet_amount(account)
4444
take_new_bet = False
4545

46-
4746
spin_animation(account)
4847
clear_screen()
4948
display_topbar(account, **HEADER_OPTIONS)

casino/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
# To add a new game, just add a handler function to GAME_HANDLERS
2727
GAME_HANDLERS: dict[str, Callable[[Account], None]] = {
2828
"blackjack": play_blackjack,
29+
"slots": play_slots,
2930
}
3031
games = list(GAME_HANDLERS.keys())
3132

0 commit comments

Comments
 (0)