Przeglądaj źródła

Implement string mode

ApisNecros 1 rok temu
rodzic
commit
8ff68bd01a
1 zmienionych plików z 6 dodań i 1 usunięć
  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 {