|
@@ -484,6 +484,20 @@ module.exports = class Computer {
|
|
|
return this.HasOutput() ? this.outputValues.shift() : undefined;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Accept input from an external source
|
|
|
+ *
|
|
|
+ * The input given here is pushed onto the end of the computer's runtime
|
|
|
+ * input array.
|
|
|
+ *
|
|
|
+ * @param {number} inputValue The number to push onto the runtime input array
|
|
|
+ * @returns {void}
|
|
|
+ */
|
|
|
+ Input(inputValue) {
|
|
|
+ this.runtimeInput.push(inputValue);
|
|
|
+ if (this.running && this.awaitingInput) { this.Run(); }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Resets the computer's memory to the value it was created with
|
|
|
*
|