Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanroat committed Nov 4, 2018
0 parents commit a1884af
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>

<body>
<h1>Fizz Buzz</h1>
</body>
<script>

function fizzbuzz(end) {
let i = 0;
let fizz, buzz = false;
for (i = 1; i <= end; i++) {
fizz = i % 3;
buzz = i % 5;
if ((!fizz) && (!buzz)) {
document.writeln(`fizz-buzz`);
}
else if (!fizz) {
document.writeln(`fizz`);
}
else if (!buzz) {
document.writeln(`buzz`);
}
else {
document.writeln(i);
}
}
}

fizzbuzz(100);
</script>

</html>

0 comments on commit a1884af

Please sign in to comment.