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
33 changes: 33 additions & 0 deletions chessboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>

// 8 x 8 GRID CHESSBOARD
var chessBoard = " ";
var size = 8;


for(let row = 0; row < size; row++){
for ( let colume = 0; colume < size; colume++){
if ((row + colume) % 2 == 0){ // Checks for even numbers, then display them as empty spaces on the chessboard
chessBoard += " ";
}
else {
chessBoard += "#"; // Displays odd numbers as the "#" characters on the chessboard
}
}
chessBoard += "\n"; //Separates one line from the other
}

console.log(chessBoard);

</script>
</body>
</html>
33 changes: 33 additions & 0 deletions fizzbuzz..html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
// TO PRINT NUMBERS 1 - 100
var number = 1;
for (let number = 1; number <= 100; number++){


if (number % 3 == 0 && number % 5 == 0){ // CHECK IF NUMBER IS DIVISIBLE BY 3 and 5
console.log("FizzBuzz")
}

else if (number % 3 == 0){ // CHECK IF NUMBER IS DIVISIBLE BY 3
console.log("Fizz")
}
else if (number % 5 == 0){ // CHECK IF NUMBER IS DIVISIBLE BY 5
console.log("Buzz")
}
else {
console.log(number)
}

}
</script>
</body>
</html>