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
71 changes: 71 additions & 0 deletions chess.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!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>
// var chess = "";
// var number = prompt(`Enter a number`);
// var total = number * number;
// var row = 1;
// var column = 1;

// for (i = 1; i <= total; i++) {
// var x;
// if ((row + column) % 2 == 0) {
// x = " # ";

// } else x = " ";
// column++;
// if (i % number == 0) {
// x += "\n";
// row++;
// column = 1;
// }
// chess += x;
// }
// console.log(chess);


var size = 8;
var block = "#";
var space = " ";

function chessBoard(chessSize){
for ( var i = 0; i < chessSize; i++){
var drawLine = " ";
for (var y = 0; y < chessSize; y++){
if (i % 2 ){
if (y % 2) {
drawLine = drawLine + space;
} else {
drawLine = drawLine + block;
}
}else {
if (y % 2){
drawLine = drawLine + block;

} else {
drawLine = drawLine + space;
}
}

}

console.log(drawLine);
}
}
chessBoard(size);
</script>
</body>

</html>
32 changes: 32 additions & 0 deletions fizz.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!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>

for (var n=1; n < 101; n++ ){
if( (n%3) === 0 && (n%5) === 0 )
console.log ("FizzBuzz");
else if( (n%3) === 0 ) {
console.log( "Fizz");

} else if ( (n%5) === 0 ){
console.log("Buzz");
}else {
console.log(n);
}


}

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