Prechádzať zdrojové kódy

Implement mirrors and direction changes

ApisNecros 1 rok pred
rodič
commit
fd1e800fb7
1 zmenil súbory, kde vykonal 29 pridanie a 0 odobranie
  1. 29 0
      starfish.js

+ 29 - 0
starfish.js

@@ -220,6 +220,35 @@ class CodeBox {
                 this.stack.Push(y % x);
                 break;
             }
+            // Movement
+            case "^":
+                this.MoveUp();
+                break;
+            case ">":
+                this.MoveRight();
+                break;
+            case "v":
+                this.MoveDown();
+                break;
+            case "<":
+                this.MoveLeft();
+                break;
+            // Mirrors
+            case "/":
+                this.ReflectForward();
+                break;
+            case "\\":
+                this.ReflectBack();
+                break;
+            case "_":
+                this.VerticalMirror();
+                break;
+            case "|":
+                this.HorizontalMirror();
+                break;
+            case "#":
+                this.OmniMirror();
+                break;
             // Output
             case "n": 
                 output = this.stack.Pop();