Befunge program looping unexpectedly at @

97 views Asked by At

I've got a befunge program that takes a number from the user, compares it to another number and if it is correct then outputs a "y" and exits (otherwise it loops back to the start).

v     <                                                                         
>& v>-|                                                                         
      >"y",@                                                                    



   6                                                                            
   >^   

The bottom constant 6 is designed to be replaced with a random number generator in future. As I step through the program (using https://amicloud.github.io/fungide/) and it gets to the >"y",@ every time it reaches @ it loops back to >. Why is this?

1

There are 1 answers

0
Jachdich On

The problem is the interpreter, not the program. I've written an interpreter and it works perfectly, and I've used a different online interpreter and it also runs correctly. https://amicloud.github.io/fungide/ seems to run fine in run mode but not in step mode.