From 175c027f230e898723a2ff5321c9b027adc5e67f Mon Sep 17 00:00:00 2001 From: Resilient08 <58645288+Resilient08@users.noreply.github.com> Date: Mon, 29 Jun 2020 16:55:15 -0400 Subject: [PATCH 1/3] Javascript Day 1 Work --- assets/js/shapes.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index e4351ba..0755925 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -1,15 +1,32 @@ function getLine(length) { // TODO - write method definition here + let output = ""; + let length = 7; + for (let i=0; i<7; i++) { + output +="*"; + } + + return output; + } + function getBox(width, height) { // TODO - write method definition here + let output = ""; + for ( let i=0; i Date: Mon, 29 Jun 2020 20:07:53 -0400 Subject: [PATCH 2/3] updates --- assets/js/shapes.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 0755925..468be90 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -1,8 +1,7 @@ function getLine(length) { // TODO - write method definition here let output = ""; - let length = 7; - for (let i=0; i<7; i++) { + for (let i=0; i Date: Mon, 29 Jun 2020 23:31:21 -0400 Subject: [PATCH 3/3] updates --- assets/js/shapes.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 468be90..fd33c44 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -35,7 +35,7 @@ function getBox(width, height) { function getBottomLeftTriangle(length) { // TODO - write method definition here - var output""; + var output= ""; for(i=1; i<=length; i++) { output=output + getLine(i) + "\n"; } @@ -45,13 +45,34 @@ function getBottomLeftTriangle(length) { function getUpperLeftTriangle(length) { // TODO - write method definition here + var output= ""; + for(i=5; i>=length; i--) { + output=output + getLine(i) + "\n"; + } + return output; } function getPyramid(length) { // TODO - write method definition here + for(var i=1; i<=length; i++) +{ +for(var k=1; k<=( length-i ); k++) +{ +return (" "); +} +for(var j=1; j<=i; j++) +{ +return("* "); +} +return("
"); } + + return output; +} + + function getCheckerboard(width, height) {