Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run out of funds run out of fun or nah #1

Open
HWMNBN opened this issue Sep 30, 2022 · 3 comments
Open

run out of funds run out of fun or nah #1

HWMNBN opened this issue Sep 30, 2022 · 3 comments

Comments

@HWMNBN
Copy link

HWMNBN commented Sep 30, 2022

when the balance is null after spinning we need to deposit more.

soo in the spin function i believe this is needed

if total_bet > balance <= 0:
print(f" You do not have enough to bet that amount, your current balance is: ${balance}")
main()

@HWMNBN
Copy link
Author

HWMNBN commented Sep 30, 2022

dont really know how to use github to fix it myself.. yet.

also "quit()" is needed instead of break for the block containing

if answer == "q":
quit()

i fixed these problems after the tutorial was finished
(pat on my back bc i did it by myself didnt think it would wwork and took bout 3 to 4 hours but i got it yay me!! and yay education)

@HWMNBN HWMNBN closed this as completed Sep 30, 2022
@HWMNBN HWMNBN reopened this Sep 30, 2022
@Ch3nk
Copy link

Ch3nk commented Feb 11, 2023

def main():
balance = deposit()
while True:
print(f"Current balance is ${balance}")
if balance <= 0:
print("You've lost everything :'(")
answer = input(f"Press enter to Start (q to quit)")
if answer == "q":
quit()
else:
main()
answer = input(f"Press enter to play (q to quit)")
if answer == "q":
quit()
balance += spin(balance)

print(f"You left with ${balance}")

main()

will do the job aswell

@7777xm
Copy link

7777xm commented Dec 24, 2023

I'm fairly new to python and this walk through was great. I understood a lot of it but there are parts of it that were still beyond what I know. I got stuck in a loop when my balance reached zero. I'm not sure it was a proper way to get out of it but I added to the main function. It printed out and exited as expected.

if balance == 0:
print("You lost all of your money!")
break
else:

Updated.
def main():
balance = deposit()
while True:
print(f"Current balance is ${balance}")
if balance == 0:
print("You lost all of your money!")
break
else:
answer = input("Press enter to play (q to quit).")
if answer == "q":
break
balance += spin(balance)

print(f"You left with ${balance}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants