diff --git a/assets/js/footer-functions.js b/assets/js/footer-functions.js index 42cc05b..a6ff491 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() { diff --git a/assets/js/header-functions.js b/assets/js/header-functions.js index d17b814..0a0983a 100644 --- a/assets/js/header-functions.js +++ b/assets/js/header-functions.js @@ -21,4 +21,4 @@ function testGetUpperLeftTriangle(expectedOutput, numberOfStars) { function testGetBottomLeftTriangle(expectedOutput, numberOfStars) { test(expectedOutput, getBottomLeftTriangle, numberOfStars); -} \ No newline at end of file +} diff --git a/assets/js/shapes.js b/assets/js/shapes.js index e4351ba..f6564de 100644 --- a/assets/js/shapes.js +++ b/assets/js/shapes.js @@ -1,31 +1,87 @@ function getLine(length) { // TODO - write method definition here + var output = ""; + for (var i=0; ii; j--){ + output+= "*"; + } output = output + "\n"; + + } return output; } function getPyramid(length) { // TODO - write method definition here + var output = ""; +for(i=1;i <=length; i++){ + for(k=1; k<=length-i; k++){ + output+= " "; + } + for(j=1; j<=i;j++ ){ + for(l=1; l