Found a way to get stuck in a loop, any way to force close?
-
Hello!
I'm having fun so far with Fuze. But I just locked myself in a loop and I finally got out of it but it was difficult! I had to spam the + button on my controller and it was still difficult even when I did this. Spamming F5 didn't work and I was originally asking if there's a way to force close a program but I finally escaped with the + button. I'm also not sure if this is the right place to post this and if it's not, then I hope it can be moved. I'll tell you how to do it so you can see how hard it is to escape! My code is this:
loop clear() print("I'm thinking of a number") answer = input("Guess the number") update() repeat
My code is probably not correct (and I'm also sure it'll loop without the print part or the text) but it would still be helpful if it were easier to get out of this loop in case of mistakes like this!
Thanks for reading.
-
I think it's fair - I think you may have found a bug, but one of the devs will probably respond in the morning,
Certainly I'd say that in this instance the loop isn't really valid because outside of this trivial test you'd be expected to then go on and do something with the value, like determine if the user guessed correctly or not.
So...
printat(0, 0, "I'm thinking of a number") answer = input("Guess the number", false) sleep(600)
But don't bother to try that it won't work because I think the real bug that you've possibly found is that the input command doesn't seem to cause execution to wait for your response as you'd reasonably expect it to do.
Like I say, let's see what the dev's come back with - there may be some other intended behaviour or use-case to the command.
You've probably worked this out by now but I found it easy enough to quit the program by holding down the + button at the same time as clicking enter to give my answer. The + was then caught before execution looped round again.
[EDIT] I'll raise it as a bug - I think that it should either wait for the user or the help should say otherwise. I'm happy to be corrected if I'm wrong.
-
@Martin Yeah I think it's the input! I was messing around some more and even copying the official example from the help section on print() without modifying it does the same thing. :(
-
OK, confirmed as a bug and will be fixed in the next patch - thanks for reporting.
A workaround for now would be as follows...
printat(0, 0, "Some text") update() sleep(1) answer = input("Some text", false) sleep(600) // or carry on and do something
Note that none of this is in a loop and the update() and the sleep(1) are key
-
@Martin Glad to be of help! Thanks for the workaround too.