Closed civrot closed 1 year ago
Thanks for the report. I believe the problem is that, by default in debug mode, input and output don't do anything at all - meaning the ,
leaves the character E
on the stack. (and then this test program loops forever because _
never pops a 0.)
I think this is discussed somewhere in #14 and is considered undesirable behaviour of the debugger and it should probably get fixed one day.
In the meantime, there's a simple workaround: use the -w
option to send the output somewhere when using the debugger. (Similarly, use -r
if the program takes input). For example, I ran your test program with
bef -d -r output.txt test.bf
and the program did terminate correctly.
EDIT: originally I wrote -o
and -i
for the options to use; they are actually called -w
and -r
.
I just started playing around with befunge I was playing around with the debugger and noticed that it never leaves a loop, even though the code works.
For example, when running the following code in debug mode, the cursor never reaches the end. Is this an issue with the debugger, or is there something I don't understand.
"E">:# ,# _@