Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
background-color: navy;
background-color: rgb(171, 171, 218);
color: white;
}

Expand Down
6 changes: 3 additions & 3 deletions assets/js/footer-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function getBoxTests() {
}

function getBottomLeftTriangleTests() {
testGetBottomLeftTriangle("*", 1);
testGetBottomLeftTriangle("*\n**", 2);
testGetBottomLeftTriangle("*\n**\n**", 3);
testGetBottomLeftTriangle("*\n", 1);
testGetBottomLeftTriangle("*\n**\n", 2);
testGetBottomLeftTriangle("*\n**\n***\n", 3);
}

function getUpperLeftTriangleTests() {
Expand Down
68 changes: 55 additions & 13 deletions assets/js/shapes.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,73 @@
function getLine(length) {
// TODO - write method definition here
}

let lineExpected= "";
for(let loopCounter = 0; loopCounter < length; loopCounter++){
lineExpected = lineExpected + "*";
}
return lineExpected;
}


function getBox(width, height) {
// TODO - write method definition here
let lineExpected= "";
for(let lineLoopCounter = 0; lineLoopCounter < width; lineLoopCounter++){
for(let culLoopCounter = 0; culLoopCounter < height; culLoopCounter++){
lineExpected = lineExpected + "*";
}
lineExpected = lineExpected + "\n";
}
return lineExpected;
}



function getBottomLeftTriangle(length) {
// TODO - write method definition here
let lineExpected= "";
for(let lineLoopCounter = 0; lineLoopCounter <= length; lineLoopCounter++){
for(let culLoopCounter = 0; culLoopCounter < lineLoopCounter; culLoopCounter++){
lineExpected = lineExpected + "*";
}
lineExpected = lineExpected + "\n";
}
return lineExpected;
}


function getUpperLeftTriangle(length) {
// TODO - write method definition here
let lineExpected= "";
for(let lineLoopCounter = length; lineLoopCounter >= 0; lineLoopCounter--){
for(let culLoopCounter = lineLoopCounter ; culLoopCounter > 0; culLoopCounter--){
lineExpected = lineExpected + "*";
}
lineExpected = lineExpected + "\n";
}
return lineExpected;
}



function getPyramid(length) {
// TODO - write method definition here
let lineExpected= "";
for(let lineLoopCounter = 0; lineLoopCounter <= length; lineLoopCounter++){
if (lineLoopCounter %2 != 0){
for(let culLoopCounter = 0; culLoopCounter < lineLoopCounter; culLoopCounter++){
lineExpected = lineExpected + "*";
}
}
lineExpected = lineExpected + "\n";
}
return lineExpected;
}


function getCheckerboard(width, height) {
// TODO - write method definition here
}
let lineExpected= "_";
for(let lineLoopCounter = 0; lineLoopCounter < width; lineLoopCounter++){
for(let culLoopCounter = 0; culLoopCounter < height; culLoopCounter++){
i = lineExpected.charAt(myString.length - 1)
if (i == "\n")
lineExpected.charAt(myString.length - 2)
if(i == "*")
lineExpected = lineExpected + "_";
else
lineExpected = lineExpected + "*";
}
lineExpected = lineExpected + "\n";
}
return lineExpected;
}