From a58b9dc894ed31b864f1d9b2e1f7c5ef81faab52 Mon Sep 17 00:00:00 2001 From: David Frary Date: Mon, 29 Jun 2020 16:31:27 -0400 Subject: [PATCH 01/12] finished edits on 'index.html' --- assets/js/shapes.js | 43 ++++++++++++++++++++++++++++++++++--------- index.html | 5 ----- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index e4351ba..f7fe866 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -1,31 +1,56 @@ -function getLine(length) { - // TODO - write method definition here -} + function getLine(length) { + +let output = ""; +for (let i=0; i From 8b37663375e07147b65c6a11fff02ea2e2ee8aec Mon Sep 17 00:00:00 2001 From: David Frary Date: Mon, 29 Jun 2020 16:52:24 -0400 Subject: [PATCH 02/12] finished edits on 'index.html' --- assets/js/header-functions.js | 51 +++++++++++++++++++++++++---------- assets/js/shapes.js | 5 ++-- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/assets/js/header-functions.js b/assets/js/header-functions.js index d17b814..1905361 100644 --- a/assets/js/header-functions.js +++ b/assets/js/header-functions.js @@ -1,24 +1,47 @@ -function testGetLine(expectedOutput, numberOfStars) { - test(expectedOutput, getLine, numberOfStars); -} +getLineTests(); +getBoxTests(); +getBottomLeftTriangleTests(); +getUpperLeftTriangleTests(); +getPyramidTests(); +getCheckerboardTests(); + + + -function testGetBox(expectedOutput, width, height) { - test(expectedOutput, getBox, width, height); +function getLineTests() { + testGetLine("*", 1); + testGetLine("**", 2); + testGetLine("***", 3); } -function testGetCheckerboard(expectedOutput, width, height) { - test(expectedOutput, getCheckerboard, width, height); +function getBoxTests() { + testGetBox("*\n", 1, 1); + testGetBox("**\n**\n", 2, 2); + testGetBox("***\n***\n***\n***\n", 3, 4); } -function testGetPyramid(expectedOutput, numberOfStars) { - test(expectedOutput, getPyramid, numberOfStars); +function getBottomLeftTriangleTests() { + testGetBottomLeftTriangle("*", 1); + testGetBottomLeftTriangle("*\n**", 2); + testGetBottomLeftTriangle("*\n**\n***", 3); } -function testGetUpperLeftTriangle(expectedOutput, numberOfStars) { - test(expectedOutput, getUpperLeftTriangle, numberOfStars); +function getUpperLeftTriangleTests() { + testGetUpperLeftTriangle("*", 1); + testGetUpperLeftTriangle("**\n*", 2); + testGetUpperLeftTriangle("***\n**\n*", 3); } -function testGetBottomLeftTriangle(expectedOutput, numberOfStars) { - test(expectedOutput, getBottomLeftTriangle, numberOfStars); -} \ No newline at end of file + +function getPyramidTests() { + testGetPyramid("*", 1); + testGetPyramid(" * \n***", 2); + testGetPyramid(" * \n *** \n*****", 3); +} + + +function getCheckerboardTests() { + testGetCheckerboard(" *\n* \n", 2, 2); + testGetCheckerboard(" * \n* *\n * \n", 3, 3); + testGetCheckerboard(" * \n* *\n * \n* *\n", 3, 4); \ No newline at end of file diff --git a/assets/js/shapes.js b/assets/js/shapes.js index f7fe866..723224e 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -14,11 +14,12 @@ return output; for (let i=0; i Date: Mon, 29 Jun 2020 16:53:44 -0400 Subject: [PATCH 03/12] finished edits on 'index.html' --- assets/js/footer-functions.js | 6 ++--- assets/js/header-functions.js | 51 ++++++++++------------------------- 2 files changed, 17 insertions(+), 40 deletions(-) diff --git a/assets/js/footer-functions.js b/assets/js/footer-functions.js index 42cc05b..4ee25ea 100644 --- a/assets/js/footer-functions.js +++ b/assets/js/footer-functions.js @@ -24,7 +24,7 @@ function getBoxTests() { function getBottomLeftTriangleTests() { testGetBottomLeftTriangle("*", 1); testGetBottomLeftTriangle("*\n**", 2); - testGetBottomLeftTriangle("*\n**\n**", 3); + testGetBottomLeftTriangle("*\n**\n***", 3); } function getUpperLeftTriangleTests() { @@ -42,7 +42,7 @@ function getPyramidTests() { function getCheckerboardTests() { - testGetCheckerboard(" *\n* ", 2, 2); - testGetCheckerboard(" * \n* *\n * ", 3, 3); + testGetCheckerboard(" *\n* \n", 2, 2); + testGetCheckerboard(" * \n* *\n * \n", 3, 3); testGetCheckerboard(" * \n* *\n * \n* *\n", 3, 4); } \ No newline at end of file diff --git a/assets/js/header-functions.js b/assets/js/header-functions.js index 1905361..d17b814 100644 --- a/assets/js/header-functions.js +++ b/assets/js/header-functions.js @@ -1,47 +1,24 @@ -getLineTests(); -getBoxTests(); -getBottomLeftTriangleTests(); -getUpperLeftTriangleTests(); -getPyramidTests(); -getCheckerboardTests(); - - - - -function getLineTests() { - testGetLine("*", 1); - testGetLine("**", 2); - testGetLine("***", 3); +function testGetLine(expectedOutput, numberOfStars) { + test(expectedOutput, getLine, numberOfStars); } - -function getBoxTests() { - testGetBox("*\n", 1, 1); - testGetBox("**\n**\n", 2, 2); - testGetBox("***\n***\n***\n***\n", 3, 4); +function testGetBox(expectedOutput, width, height) { + test(expectedOutput, getBox, width, height); } -function getBottomLeftTriangleTests() { - testGetBottomLeftTriangle("*", 1); - testGetBottomLeftTriangle("*\n**", 2); - testGetBottomLeftTriangle("*\n**\n***", 3); -} -function getUpperLeftTriangleTests() { - testGetUpperLeftTriangle("*", 1); - testGetUpperLeftTriangle("**\n*", 2); - testGetUpperLeftTriangle("***\n**\n*", 3); +function testGetCheckerboard(expectedOutput, width, height) { + test(expectedOutput, getCheckerboard, width, height); } - -function getPyramidTests() { - testGetPyramid("*", 1); - testGetPyramid(" * \n***", 2); - testGetPyramid(" * \n *** \n*****", 3); +function testGetPyramid(expectedOutput, numberOfStars) { + test(expectedOutput, getPyramid, numberOfStars); } +function testGetUpperLeftTriangle(expectedOutput, numberOfStars) { + test(expectedOutput, getUpperLeftTriangle, numberOfStars); +} -function getCheckerboardTests() { - testGetCheckerboard(" *\n* \n", 2, 2); - testGetCheckerboard(" * \n* *\n * \n", 3, 3); - testGetCheckerboard(" * \n* *\n * \n* *\n", 3, 4); \ No newline at end of file +function testGetBottomLeftTriangle(expectedOutput, numberOfStars) { + test(expectedOutput, getBottomLeftTriangle, numberOfStars); +} \ No newline at end of file From a91438dd14b4819d185315b89b52392e9f2365fd Mon Sep 17 00:00:00 2001 From: David Frary Date: Mon, 29 Jun 2020 21:13:19 -0400 Subject: [PATCH 04/12] finished edits on 'index.html' --- assets/js/shapes.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 723224e..3a377f3 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -9,17 +9,23 @@ for (let i=0; i Date: Mon, 29 Jun 2020 22:11:23 -0400 Subject: [PATCH 05/12] finished edits on 'index.html' --- assets/js/shapes.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 3a377f3..765215f 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -1,5 +1,7 @@ + +//Line function getLine(length) { let output = ""; @@ -10,7 +12,7 @@ return output; } -// +//Box function getBox(width, height) { let output1 = ""; let output2 = ""; @@ -25,7 +27,7 @@ return output2; } -// +//Bottom Left Triangle function getBottomLeftTriangle(length) { let output = ""; for (let i=0; i Date: Tue, 30 Jun 2020 08:58:16 -0400 Subject: [PATCH 06/12] finished edits on 'index.html' --- assets/js/shapes.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 765215f..d234c89 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -32,9 +32,12 @@ function getBottomLeftTriangle(length) { let output = ""; for (let i=0; i Date: Tue, 30 Jun 2020 09:15:12 -0400 Subject: [PATCH 07/12] finished edits on 'shapes.js' --- assets/js/shapes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index d234c89..3b4a7cf 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -21,7 +21,7 @@ return output; output1 += "*"; } for (let i=0; i Date: Tue, 30 Jun 2020 12:51:37 -0400 Subject: [PATCH 08/12] finished edits on 'shapes.js' --- assets/js/shapes.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 3b4a7cf..b20b311 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -21,7 +21,7 @@ return output; output1 += "*"; } for (let i=0; i=i; j--){ output += "*"; - for (let j=1; j=i; j--){ output += "*"; + } + output += "\n"; } return output; -} + } //Pyramid @@ -66,7 +69,8 @@ function getCheckerboard(width, height) { let output2 = ""; for (let i=0; i Date: Tue, 30 Jun 2020 14:31:38 -0400 Subject: [PATCH 09/12] finished edits on 'shapes.js' --- assets/js/shapes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index b20b311..837f8ec 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -31,7 +31,7 @@ return output2; function getBottomLeftTriangle(length) { let output = ""; for (let i=0; i<=length; i++){ - for (let j=length-1; j>=i; j--){ + for (let j=0; j<=i; j++){ output += "*"; } output += "\n"; From 458140af8b7cb52b4c0bfbec17c1a7edc75d6473 Mon Sep 17 00:00:00 2001 From: David Frary Date: Tue, 30 Jun 2020 14:32:50 -0400 Subject: [PATCH 10/12] finished edits on 'shapes.js' --- assets/js/shapes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 837f8ec..255084e 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -30,7 +30,7 @@ return output2; //Bottom Left Triangle function getBottomLeftTriangle(length) { let output = ""; - for (let i=0; i<=length; i++){ + for (let i=0; i Date: Wed, 1 Jul 2020 10:34:36 -0400 Subject: [PATCH 11/12] finished edits on 'shapes.js' --- assets/js/shapes.js | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 255084e..4c81619 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -30,11 +30,11 @@ return output2; //Bottom Left Triangle function getBottomLeftTriangle(length) { let output = ""; - for (let i=0; i=i; j--){ + for (let i=0; ii; j--){ output += "*"; } output += "\n"; @@ -54,12 +54,22 @@ function getUpperLeftTriangle(length) { //Pyramid -function getPyramid(length) { +function getPyramid(length) +{ let output = ""; - for (let i=0; i Date: Wed, 1 Jul 2020 11:40:10 -0400 Subject: [PATCH 12/12] finished edits on 'shapes.js' --- assets/js/shapes.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/assets/js/shapes.js b/assets/js/shapes.js index 4c81619..9a1f252 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -34,7 +34,7 @@ function getBottomLeftTriangle(length) { for (let j=0; j