Browse Source

Add parameters to Computer documentation

Added documentation for the Computer's constructor's parameters. Also
moved the comment down to fix VS Code's parsing.
ApisNecros 1 year ago
parent
commit
35a7b270a4
1 changed files with 9 additions and 5 deletions
  1. 9 5
      IntComp/Computer.js

+ 9 - 5
IntComp/Computer.js

@@ -5,12 +5,16 @@ const Stack = require("./Stack");
 const ComputerParameterMode = require("./ComputerParameterMode");
 const { DeepClone } = require("./common");
 
-/**
- * An Intcode Computer for the Advent of Code 2019 challenge
- *
- * @author Apis Necros
- */
 module.exports = class Computer {
+    /**
+     * An Intcode Computer for the Advent of Code 2019 challenge
+     *
+     * @author Apis Necros
+     *
+     * @param {number[]} stack The initial memory to load into the 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
+     */
     constructor(stack, options = {}) {
         this._initialMemory = DeepClone(stack);
         this.stack = new Stack(stack);