/** * 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, 25, 1001, 25, 0, 24, 1001, 24, -1, 24, 1006, 24, 20, 2, 25, 24, 25, 1005, 24, 6, 4, 25, 99]; const c = new Computer(program, { inputFromConsole: true, outputToConsole: true, }); c.Run();