Open rdebath opened 5 years ago
I was looking at your program and I was a bit confused about a large portion of it, it seemed to be completely unnecessary to me so I deleted it, (the part I'm talking about is the [[]<<++>>][+] part), after deleting this I got ++++++++++[>++++++++>+<<-]>-.<----[>-<+]>.>. which does work with my interpreter. Though the original should work. this is probably a problem with the way my interpreter is skipping the brackets. I will fix this and get back to you.
lol sorry did not mean to close the issue
the issue was that when I was skipping past the empty brackets I went one token further than I should've, So in the interp function I added n -= 1 at the bottom of the if statement for "[" tokens which made it work!, Thank you so much for the feedback it really helped!
... seemed to be completely unnecessary ...
You're not wrong, from the "printing OK" point of view, the extra code is for testing interpreters. Still, this sounds like a very good reason to stick with my "Hello World" program instead, it has much less obviously "unnecessary" code.
+[>[<-[]>+[>+++>[+++++++++++>][>]-[<]>-]]++++++++++<]>
>>>>>----.<<+++.<-..+++.<-.>>>.<<.+++.------.>-.<<+.<.
Thanks for the test!
This little BF program should print
79 75 10
orOK
in ASCIIIt hangs after the first output.