123456789101112131415161718 |
- /**
- * Calculate the factorial of a given number
- *
- * Calculates the factorial of a number, outputting the final result.
- *
- * Added to the Intcode wiki by myself
- * @see https://esolangs.org/wiki/Intcode#Example_Programs
- */
- const Computer = require("../IntComp/Computer");
- const program = [3, 34, 1007, 34, 1, 35, 1005, 35, 30, 1001, 34, 0, 33, 1001, 33, -1, 33, 1006, 33, 27, 2, 34, 33, 34, 1005, 33, 13, 4, 34, 99, 104, 1, 99];
- const c = new Computer(program, {
- inputFromConsole: true,
- outputToConsole: true,
- });
- c.Run();
|