Skip to content
Open
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
54 changes: 54 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!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>
// THIS IS THE FIZZBUZZ CHALLENGE

for(i = 0; i <= 100 ; i++){
if (i % 3 == 0 && i % 5 == 0) {
console.log('fizzbuzz');
}
else if( i % 3 == 0 ){
console.log('fizz');
}
else if( i % 5 == 0){
console.log ('buzz');
}
else{ console.log( i)}
}


//THIS IS THE CHESS BOARD CHALLENGE

// the columns and rows
var n = prompt('please input number');

//
var count = ''

//for column
for (let i =1; i <= n; i++) {

//for rows
for( w = 1; w <= n ; w++){

if( (i + w) % 2 == 0 ){
count+= '#'
} else{
count+= ' '
}
}
// to add a new line
count += '\n'

}
console.log(count)
</script>
</body>
</html>