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/shapes.js b/assets/js/shapes.js index e4351ba..9a1f252 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -1,31 +1,93 @@ -function getLine(length) { - // TODO - write method definition here -} -function getBox(width, height) { - // TODO - write method definition here +//Line + function getLine(length) { + +let output = ""; +for (let i=0; ii; j--){ + output += "*"; + } + output += "\n"; + } + return output; + } -function getPyramid(length) { - // TODO - write method definition here +//Pyramid +function getPyramid(length) +{ + let output = ""; + for (let i=0; i