diff --git a/README.md b/README.md new file mode 100644 index 0000000..f428814 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# fizzbuzz + +CSCI-E32 Fizzbuzz assignment. diff --git a/index.html b/index.html index 4ef4a89..5554a6a 100644 --- a/index.html +++ b/index.html @@ -25,8 +25,11 @@
-

Hello World!

-

This is something!

+

FizzBuzz!

+

Enter a positive value!

+ + +
@@ -36,5 +39,6 @@

Hello World!

+ diff --git a/js/fizzbuzz.js b/js/fizzbuzz.js new file mode 100644 index 0000000..8e95655 --- /dev/null +++ b/js/fizzbuzz.js @@ -0,0 +1,13 @@ +function fizzbuzz(n) { + for (i = 1; i < n; i++) { + if (i % 15 == 0) { + $('#output').append('
  • fizzbuzz
  • '); + } else if (i % 5 == 0) { + $('#output').append('
  • buzz
  • '); + } else if (i % 3 == 0) { + $('#output').append('
  • fizz
  • '); + } else { + $('#output').append('
  • ' + i + '
  • '); + } + } +}