From 215565451f3831bc894c045b760cab979b7c3bf8 Mon Sep 17 00:00:00 2001 From: Junior Date: Fri, 28 Jun 2024 11:04:42 -0400 Subject: [PATCH] Add comments for areas of improvement to textslot --- PyGame/practice/textslot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PyGame/practice/textslot.py b/PyGame/practice/textslot.py index 9b26666..4db0e2f 100644 --- a/PyGame/practice/textslot.py +++ b/PyGame/practice/textslot.py @@ -125,10 +125,15 @@ def roll(balance) -> int: else: balance -= bet * lines print(f"Your balance is now: ${balance}") + # Should be returning "balance" + # "winnings - total_bet" is not at all correct return winnings - total_bet +# main() does not return a value so should not be type hinted def main() -> int: balance = deposit() + # Using "while True" requires a break to exit. + # Should instead be a conditional that tracks the actual exit conditions while True: print(f"Current Balance is ${balance}") answer = input("Press enter to play (q to quit).")