finish bf interpreter

This commit is contained in:
Sebastian Hugentobler 2025-05-28 21:28:25 +02:00
parent 2d739d98cc
commit 98dfbc8503
Signed by: shu
SSH key fingerprint: SHA256:ppcx6MlixdNZd5EUM1nkHOKoyQYoJwzuQKXM6J/t66M
6 changed files with 55 additions and 9 deletions

View file

@ -68,7 +68,7 @@ class Interpreter {
}
if (instruction == ",") {
tape.current.data = promptAscii("> ");
}
if (instruction == "[" and tape.current.data == 0) {
@ -96,5 +96,5 @@ class Interpreter {
}
}
var interpreter = Interpreter("bf/helloworld.bf");
var interpreter = Interpreter("bf/game_of_life.bf");
interpreter.run();

2
lox/read_ascii.lox Normal file
View file

@ -0,0 +1,2 @@
var a = promptAscii("> ");
print a;