From 5b5424cf1d7d8da0fb19aefbed2be7c9ff30cfa3 Mon Sep 17 00:00:00 2001 From: scmcgowen Date: Sat, 31 Jan 2026 23:33:11 -0600 Subject: [PATCH 1/2] fix crash --- prog2/BlackJack.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prog2/BlackJack.lua b/prog2/BlackJack.lua index 8d0d9dc..93b26e3 100644 --- a/prog2/BlackJack.lua +++ b/prog2/BlackJack.lua @@ -89,7 +89,7 @@ money = tonumber(money) print("what is your bet?") local bet = io.read() bet = tonumber(bet) -if bet < 20 then +if not bet or bet < 20 then bet = 20 end if bet > money then From 348919bb5240d0cd0eced6d0ab2d88a2df100bb7 Mon Sep 17 00:00:00 2001 From: scmcgowen Date: Sat, 31 Jan 2026 23:34:06 -0600 Subject: [PATCH 2/2] fix crash --- prog2/Slot.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prog2/Slot.lua b/prog2/Slot.lua index b93743f..0028b70 100644 --- a/prog2/Slot.lua +++ b/prog2/Slot.lua @@ -76,8 +76,8 @@ print("what is your bet?") bet = tonumber(io.read()) print("what is your guess 1 to 15?") userGess = tonumber(io.read()) -if bet > money then - print("You do not have enough funds") +if not bet or bet > money then + print("You do not have enough funds or did not enter a bet.") sleep(3) shell.run("reboot") end