update bf interpreter

This commit is contained in:
Sebastian Hugentobler 2025-05-28 09:40:35 +02:00
parent 94b57f8304
commit 9aa6bef6d9
Signed by: shu
SSH key fingerprint: SHA256:ppcx6MlixdNZd5EUM1nkHOKoyQYoJwzuQKXM6J/t66M

View file

@ -71,7 +71,7 @@ class Interpreter {
}
if (instruction == "[" and tape.current.data < 0.0001) {
if (instruction == "[" and tape.current.data = 0) {
instruction = read(this.bfpath);
var bracketCount = 1;
while (bracketCount > 0 and instruction != nil) {
@ -81,7 +81,7 @@ class Interpreter {
}
}
if (instruction == "]" and tape.current.data >= 0.0001) {
if (instruction == "]" and tape.current.data != 0) {
instruction = read(this.bfpath, true);
var bracketCount = 1;
while (bracketCount > 0 and instruction != nil) {