How can you get over 1? You only trigger the “Nice, your not greedy, you win!” when you type 0 or 1 but anything above and you get “Man, learn to type a number” even though “how_much” is set to less than 50
One thing you can do @MilkTaste01 is try out what you think the code should do. For example, if you think it should not use an infinite loop, then try to change it to not use one. You might come up with something better, and if not you’ll find out why I did it.
I do get why we need the infinite loop. When we navigate through the bear room, we need to taunt the bear and then open the door which gets us to the gold room. However, when we remove the “while true” loop, after we taunt the bear, it ends the script.
reason behind making while loop true is that when first time loop runs it is asking for the action which you want to perform to move bear from another door. so as you give your input “taunt bear” this will set the overall condition of elif to true and and executes the block and also set the flag bear_moved to true.
in loop one condition became true so other condition will not be tested and loop will run aging as it is infinite so now this time you are giving your input as “open door” and this time the flag bear_moved is already true so overall condition of elif will also get true and you will redirected to gold_room() function
you can also do nesting like making another function for third room and calling in if statement