update bf interpreter
This commit is contained in:
parent
94b57f8304
commit
e0ab0a6c67
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
instruction = read(this.bfpath);
|
||||||
var bracketCount = 1;
|
var bracketCount = 1;
|
||||||
while (bracketCount > 0 and instruction != nil) {
|
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);
|
instruction = read(this.bfpath, true);
|
||||||
var bracketCount = 1;
|
var bracketCount = 1;
|
||||||
while (bracketCount > 0 and instruction != nil) {
|
while (bracketCount > 0 and instruction != nil) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue