|
@@ -15,6 +15,8 @@ module.exports = class Computer {
|
|
|
* @param {Object} options Options that can be enabled within the computer
|
|
|
* @param {boolean} options.followPointer When true, the memory will be dumped every call to Execute with the current instruction highlighted
|
|
|
* @param {number} options.tickRate The number of milliseconds between calls to Execute. Initializes to 0.
|
|
|
+ * @param {boolean} options.inputFromConsole When true, the computer will prompt for input on the console. If false, it will check for an linked computer and, if one exists, will wait for input from that computer.
|
|
|
+ * @param {boolean} options.outputToConsole When true, the computer will print the output of opcode 4 to the console. If false, it will check for an linked computer and, if one exists, pass the output to that computer.
|
|
|
*/
|
|
|
constructor(stack, options = {}) {
|
|
|
this._initialMemory = DeepClone(stack);
|
|
@@ -49,6 +51,8 @@ module.exports = class Computer {
|
|
|
this.options = {
|
|
|
followPointer: options.followPointer ?? false,
|
|
|
tickRate: options.tickRate ?? 0,
|
|
|
+ inputFromConsole: options.inputFromConsole ?? false,
|
|
|
+ outputToConsole: options.outputToConsole ?? false,
|
|
|
};
|
|
|
}
|
|
|
|