demo.js 412 B

123456789101112131415161718
  1. const Computer = require("../IntComp/Computer");
  2. const input = [3, 10, 3, 12, 1, 10, 12, 12, 4, 12, 99];
  3. const c = new Computer(input, {
  4. inputFromConsole: true,
  5. outputToConsole: false,
  6. followPointer: false,
  7. tickRate: 0,
  8. });
  9. const c2 = new Computer(input);
  10. const c3 = new Computer(input);
  11. c.outputComputer = c2;
  12. c2.outputComputer = c3;
  13. c.RunWithInput(-15);
  14. console.log(c3.FetchOutputValue());