diff options
Diffstat (limited to 'chapter17')
| -rw-r--r-- | chapter17/README.md | 2 | ||||
| -rw-r--r-- | chapter17/src/test/java/com/seaofnodes/simple/BrainFuckTest.java | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/chapter17/README.md b/chapter17/README.md index fa268293..b7a1afd6 100644 --- a/chapter17/README.md +++ b/chapter17/README.md @@ -135,8 +135,8 @@ return i; // ERROR: Undefined name 'i' -pre-dec finalize final +oper-assign +=, -= TODO for-interator switch diff --git a/chapter17/src/test/java/com/seaofnodes/simple/BrainFuckTest.java b/chapter17/src/test/java/com/seaofnodes/simple/BrainFuckTest.java index 0c2509bf..4833483b 100644 --- a/chapter17/src/test/java/com/seaofnodes/simple/BrainFuckTest.java +++ b/chapter17/src/test/java/com/seaofnodes/simple/BrainFuckTest.java @@ -38,11 +38,12 @@ for( int pc = 0; pc < program#; pc++ ) { } else if (command == 45) { data[d]--; } else if (command == 46) { + // Output a byte; increase the output array size var old = output; output = new u8[output# + 1]; for( var i = 0; i < old#; i++ ) output[i] = old[i]; - output[old#] = data[d]; + output[old#] = data[d]; // Add the extra byte on the end } else if (command == 44) { data[d] = 42; } else if (command == 91) { |
