Selaa lähdekoodia

Parse numeric instruction as strings

All intructions parse from the input box are strings, so they need to be
parsed as such in the switch case.
ApisNecros 1 vuosi sitten
vanhempi
säilyke
a26d677b3b
1 muutettua tiedostoa jossa 10 lisäystä ja 10 poistoa
  1. 10 10
      starfish.js

+ 10 - 10
starfish.js

@@ -147,16 +147,16 @@ class CodeBox {
     Execute(instruction) {
         let output = null;
         switch(instruction) {
-            case 1:
-            case 2:
-            case 3:
-            case 4:
-            case 5:
-            case 6:
-            case 7:
-            case 8:
-            case 9:
-            case 0:
+            case "1":
+            case "2":
+            case "3":
+            case "4":
+            case "5":
+            case "6":
+            case "7":
+            case "8":
+            case "9":
+            case "0":
             case "a":
             case "b":
             case "c":