I still couldn't figure out the solution to my problem in my Dungeon Crawler program, so I decided to test something more basic.
Here is the same problem: If I keep pressing the same number (like 5 to 5 over and over), the program works.
BUT, if I switch to a different number on the 3rd loop (like 5 to 9, and back to 5), the program just stops instead of producing the proper print statement for 5. Why is this happening?
After loop 9-14 is done (number is not 5) you will never return to it again. So when the second loop is done (number is not 9), program will continue executing from line 21. And there is nothing but "end the program" statement.