|
@@ -1,5 +1,6 @@
|
|
|
const prompt = require("prompt-sync")({ sigint: true });
|
|
|
const util = require("util");
|
|
|
+const uuid = require("uuid");
|
|
|
|
|
|
const Stack = require("./Stack");
|
|
|
const ComputerParameterMode = require("./ComputerParameterMode");
|
|
@@ -24,6 +25,7 @@ module.exports = class Computer {
|
|
|
* @param {number[]} options.inputModeMap Map calls to the INPUT opcode to user input or the input array
|
|
|
*/
|
|
|
constructor(stack, options = {}) {
|
|
|
+ this.name = uuid.v4();
|
|
|
this._initialMemory = DeepClone(stack);
|
|
|
this.stack = new Stack(stack);
|
|
|
this.OPCODES = {
|
|
@@ -471,7 +473,7 @@ module.exports = class Computer {
|
|
|
toInspect = this[propertyName];
|
|
|
}
|
|
|
|
|
|
- console.log(outputMessage, util.inspect(toInspect, { breakLength: Infinity, colors: true, compact: true }));
|
|
|
+ console.log(this.name, outputMessage, util.inspect(toInspect, { breakLength: Infinity, colors: true, compact: true }));
|
|
|
}
|
|
|
|
|
|
/**
|