Ask coding questions

← Back to all posts
Function not running
PikachuB2005 (8)

My function gane_loop is supposed to run forever after you login, but it isn't working, and I don't know why. ALSO- I know you might have to login to see the problem, please don't use a password you have already used. If you want the account deleted just let me know

Answered by Coder100 (16855) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (16855)

Why not use recursion?

def game_loop():
  # ... insert code ...
  game_loop()

game_loop()

no dumb while loops, no dumb if statements, just recursion!

IL2PG (35)

@Coder100 welp I tried :D :( [-._.-]

PikachuB2005 (8)

Yeah. Thanks though, I wonder why it didn't work before.

PikachuB2005 (8)

@Coder100 Search recursion in google...

Chocolate16 (36)

looks like you are using the replit db not correctly. I've modified your authentication stage and added comments to make it clear. There is fork from your repl:
https://replit.com/@Chocolate16/Just-testing-something#main.py

PikachuB2005 (8)

@Chocolate16 Umm... I came back to this post just to find out... you deleted the fork. AHHHHHH

IL2PG (35)

delete old line 94,95,96 try this

IL2PG (35)

@IL2PG if this has helped please check this

IL2PG (35)

If you want it to run forever try not doing in range try while true:

PikachuB2005 (8)

@IL2PG I have
while True:
on line 95. idk