Browse Source

Add testing file for day 7

ApisNecros 1 năm trước cách đây
mục cha
commit
046b98c88f
1 tập tin đã thay đổi với 18 bổ sung0 xóa
  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());