浏览代码

Implement string mode

ApisNecros 1 年之前
父节点
当前提交
8ff68bd01a
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      starfish.js

+ 6 - 1
starfish.js

@@ -242,6 +242,11 @@ class CodeBox {
                     this.stack.push(y == x ? 1 : 0);
                     break;
                 }
+                //String mode
+                case "\"":
+                case "'":
+                    this.stringMode = !!this.stringMode ? 0 : dec(instruction);
+                    break;
                 // Movement
                 case "^":
                     this.MoveUp();
@@ -339,7 +344,7 @@ class CodeBox {
     Swim() {
         const instruction = this.box[this.pointer.Y][this.pointer.X];
 
-        if(this.stringMode != 0 && instruction != this.stringMode) {
+        if(this.stringMode != 0 && dec(instruction) != this.stringMode) {
             this.stack.Push(dec(instruction));
         }
         else {