Add comments for areas of improvement to textslot

This commit is contained in:
Junior 2024-06-28 11:04:42 -04:00
parent 6ff5a6fb23
commit 215565451f

View File

@ -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).")