From efe5099a02883357cc28374126ebc34dab0309c8 Mon Sep 17 00:00:00 2001 From: Daan Breur Date: Wed, 28 Oct 2020 16:49:08 +0100 Subject: [PATCH 1/3] Update parser.js --- parser.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parser.js b/parser.js index 811130d..3de7525 100644 --- a/parser.js +++ b/parser.js @@ -19,6 +19,7 @@ class Parser { /** * Private method * + * @private * @returns Boolean If the index has surpased the length of the text or not. * @memberof Parser */ @@ -29,6 +30,7 @@ class Parser { /** * Private method * + * @private * @returns String The next token after the actual index. * @memberof Parser */ @@ -85,6 +87,7 @@ class Parser { /** * Public method * + * @public * @returns [CommandExecutor] Parsed text converted into CommandExecutors * ready to be executed. * @memberof Parser From 65a5a30d8c686abef46bf9d58581bf206d67f01f Mon Sep 17 00:00:00 2001 From: Daan Breur Date: Wed, 28 Oct 2020 16:55:01 +0100 Subject: [PATCH 2/3] Add jsdoc to turtle.js --- turtle.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/turtle.js b/turtle.js index dfbc84a..8cddd05 100644 --- a/turtle.js +++ b/turtle.js @@ -11,11 +11,15 @@ class Turtle { this.strokeColor = 255; this.strokeWeight = 1; } - + reset() { this.pen = true; } + /** + * Move the turtle forward. + * @param {Number} amt The amount the turtle needs to move forwards + */ forward(amt) { // Move the turtle this.x += cos(this.dir) * amt; @@ -32,11 +36,18 @@ class Turtle { this.prevX = this.x; this.prevY = this.y; } - + + /** + * Rotate the turtle. + * @param {Number} angle The amount the turtle needs to rotate + */ right(angle) { this.dir += angle; } + /** + * Sets the location back to the default. + */ home() { this.x = this.homeX; this.y = this.homeY; From 51909392f470fe064e435bd6261e1512b7020190 Mon Sep 17 00:00:00 2001 From: Daan Breur Date: Wed, 28 Oct 2020 16:59:22 +0100 Subject: [PATCH 3/3] Update turtle.js --- turtle.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/turtle.js b/turtle.js index 8cddd05..b90c5a0 100644 --- a/turtle.js +++ b/turtle.js @@ -1,4 +1,12 @@ class Turtle { + + /** + * Creates an instance of the Turtle. + * @param {Number} x The home x location. + * @param {Number} y The home y location. + * @param {Number} angle The angle the turtle starts with + * @memberof Turtle + */ constructor(x, y, angle) { this.x = x; this.y = y;