[SOLVED]Why does the game loop get triggered? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

[SOLVED]Why does the game loop get triggered?

*WARNING* the code is long. (And won't work in SL) My problem is: right when i start the game and enter the "explore" command. Its gives the correct choices and even works well going foward. BUT, whenever i enter "explore" and then enter '0' to get back to the main loop that accepts commamds, the game is ended somehow and the game_loop() function is triggered. LINE 238: where it goes wrong LINE 652: game_loop() function Not sure what i did to mess it up, but I'm sure it's stupid. All i know is i set a while loop to run and accept commands while the Player is above 0 health. There's nothing i saw that'd kill the player at the lines mentioned so I'm at a stand still EDIT: its the break at line 682 https://code.sololearn.com/c2MshQeGSO1N/?ref=app

12th Apr 2021, 12:22 PM
Slick
Slick - avatar
3 Answers
+ 1
good bro i like your game good luck broo!
16th Apr 2021, 12:53 AM
Imrane Aabbou
Imrane Aabbou - avatar
0
hi i copy your game's code and i run it in my terminal but i dont know what is exactly your problem. can you explain it well i'll help you if i can.
16th Apr 2021, 12:47 AM
Imrane Aabbou
Imrane Aabbou - avatar
0
Yo I really appreciate that 0MR4N , but i found the issue. It was a silly break at line 682! Thats the only reason i added the "EDIT" and [SOLVED] in the title. Thanks though man
16th Apr 2021, 12:49 AM
Slick
Slick - avatar