finish bf interpreter
This commit is contained in:
parent
2d739d98cc
commit
98dfbc8503
6 changed files with 55 additions and 9 deletions
|
@ -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
2
lox/read_ascii.lox
Normal file
|
@ -0,0 +1,2 @@
|
|||
var a = promptAscii("> ");
|
||||
print a;
|
Loading…
Add table
Add a link
Reference in a new issue