Răsfoiți Sursa

Add testing file for day 7

ApisNecros 1 an în urmă
părinte
comite
046b98c88f
1 a modificat fișierele cu 18 adăugiri și 0 ștergeri
  1. 18 0
      7/demo.js

+ 18 - 0
7/demo.js

@@ -0,0 +1,18 @@
+const Computer = require("../IntComp/Computer");
+
+const input = [3, 10, 3, 12, 1, 10, 12, 12, 4, 12, 99];
+
+const c = new Computer(input, {
+    inputFromConsole: true,
+    outputToConsole: false,
+    followPointer: false,
+    tickRate: 0,
+});
+const c2 = new Computer(input);
+const c3 = new Computer(input);
+
+c.outputComputer = c2;
+c2.outputComputer = c3;
+
+c.RunWithInput(-15);
+console.log(c3.FetchOutputValue());