From 24e94242ba1c55bb56f432e37f5fd98e8682dacc Mon Sep 17 00:00:00 2001 From: Claudia Giancola Date: Mon, 1 Jul 2024 15:04:07 +0100 Subject: [PATCH 1/8] Hello World --- fizzbuzz.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index ef1e96a..c423ea3 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -5,7 +5,7 @@ function fizzbuzz() { console.log('Welcome to FizzBuzz!'); - // Put your code here... + console.log('Hello World!'); } From bb3e6c998fef9ae7b07b3733ee4eaa89882c4bfd Mon Sep 17 00:00:00 2001 From: Claudia Giancola Date: Mon, 1 Jul 2024 15:08:12 +0100 Subject: [PATCH 2/8] Numbers 1-100 --- fizzbuzz.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index c423ea3..cb3276e 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -5,8 +5,9 @@ function fizzbuzz() { console.log('Welcome to FizzBuzz!'); - console.log('Hello World!'); - + for (let i=1; i <= 100; i++) { + console.log(i); + } } From 9705334106f5d0782a9efc106b1a57c3d3147549 Mon Sep 17 00:00:00 2001 From: Claudia Giancola Date: Mon, 1 Jul 2024 15:12:54 +0100 Subject: [PATCH 3/8] Fizz --- fizzbuzz.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index cb3276e..18e3c2a 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -6,7 +6,11 @@ function fizzbuzz() { console.log('Welcome to FizzBuzz!'); for (let i=1; i <= 100; i++) { - console.log(i); + if (i%3 === 0) { + console.log("Fizz"); + } else { + console.log(i); + } } } From d8ab77d4bb19277a62462b6b290017dbac1f3808 Mon Sep 17 00:00:00 2001 From: Claudia Giancola Date: Mon, 1 Jul 2024 15:15:45 +0100 Subject: [PATCH 4/8] FizzBuzz --- fizzbuzz.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index 18e3c2a..a947412 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -6,9 +6,15 @@ function fizzbuzz() { console.log('Welcome to FizzBuzz!'); for (let i=1; i <= 100; i++) { - if (i%3 === 0) { + if (i % 3 === 0 && i % 5 === 0) { + console.log("FizzBuzz"); + } + else if (i % 3 === 0) { console.log("Fizz"); - } else { + } else if (i % 5 === 0) { + console.log("Buzz"); + } + else { console.log(i); } } From 4202541da3ea15da7a12fe6cc89cad17cd5c7cf6 Mon Sep 17 00:00:00 2001 From: Claudia Giancola <106391530+claudiaGiancola@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:33:10 +0100 Subject: [PATCH 5/8] Updated README.md --- README.md | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e32ad1d..62d043f 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,37 @@ # FizzBuzz -1. Fork this repo - * Go to this repo's GitHub page (https://github.com/techswitch-learners/Fizzbuzz-js) - * Click `Fork` in the top-right of the page - this will create a copy of this repo in **your own GitHub account** +Run this command to run your code: +`node fizzbuzz.js` -2. Clone (download) the repo - * Go to your newly-created fork of the repo (on GitHub). - * Click `Clone or download` (the green button on the right). - * Make sure the page says `Clone with HTTPS` (rather than `Clone with SSH`). - * Open your git client (e.g. Git bash or GitKraken) and use this link to clone the repo. - Your trainer will able to help you with this. +###Learning goals -3. "Cloning the repo" will create a folder on your computer with the files from this repo. -Open this folder in Visual Studio Code. +Basic goals: +- Basic JS Syntax +- Basics of git +- Debugging in VSCode > breakpoints, Watch -4. Open a command-prompt in this same folder. -Your trainer can show you how to do this, if you need any help. +Bonus Goals: +- Writing clean code -5. Run this command to run your code: -`node fizzbuzz.js` +###Set up +Install node.js +Install Git Bash +Add `.gitignore` file + +Useful git commands: +`git status` +`git add .` +`git commit -m "Informative commit message goes here"` +`git push` + +###Incremental updates +1. Print every number from 1 to 100. +2. Print “Fizz“ whenever the number is a multiple of 3 instead of the number itself. +3. Print “Buzz” whenever the number is a multiple of 5. Print “FizzBuzz” whenever the number is a multiple of 3 and 5. +4. If a number is a multiple of 7, print "Bang" instead of the number. For numbers which are multiples of seven and three / five, append Bang to what you'd have printed anyway. (E.g. 3 * 7 = 21: "FizzBang"). +5. If a number is a multiple of 11, print "Bong" instead of the number. Do not print anything else in these cases. (E.g. 3 * 11 = 33: "Bong") +6. If a number is a multiple of 13, print "Fezz" instead of the number. For multiples of most other numbers, the Fezz goes immediately in front of the first thing beginning with B, or at the end if there are none. (E.g. 5 * 13 = 65: "FezzBuzz", 3 * 5 * 13 = 195: "FizzFezzBuzz"). Note that Fezz should be printed even if Bong is also present (E.g. 11 * 13 = 143: "FezzBong") +7. If a number is a multiple of 17, reverse the order in which any fizzes, buzzes, bangs etc. are printed. (E.g. 3 * 5 * 17 = 255: "BuzzFizz") +8. Prompt the user for a maximum number +9. Allow the user to specify command-line-options (Let the user pass in which rules to implement) +10. Can you write the Fizz, Buzz, Bang version in a single line? From 9700d82e61b6ff6beefea4a4f67a3886d5889ee8 Mon Sep 17 00:00:00 2001 From: Claudia Giancola <106391530+claudiaGiancola@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:33:37 +0100 Subject: [PATCH 6/8] Updated README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62d043f..9c79e41 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Run this command to run your code: `node fizzbuzz.js` -###Learning goals +### Learning goals Basic goals: - Basic JS Syntax @@ -13,7 +13,7 @@ Basic goals: Bonus Goals: - Writing clean code -###Set up +### Set up Install node.js Install Git Bash Add `.gitignore` file @@ -24,7 +24,7 @@ Useful git commands: `git commit -m "Informative commit message goes here"` `git push` -###Incremental updates +### Incremental updates 1. Print every number from 1 to 100. 2. Print “Fizz“ whenever the number is a multiple of 3 instead of the number itself. 3. Print “Buzz” whenever the number is a multiple of 5. Print “FizzBuzz” whenever the number is a multiple of 3 and 5. From 6e0d5fdaa0315b43a26ab7247cc9ad3f3da5db70 Mon Sep 17 00:00:00 2001 From: Claudia Giancola <106391530+claudiaGiancola@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:57:06 +0100 Subject: [PATCH 7/8] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 9c79e41..b6e9374 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,9 @@ Run this command to run your code: ### Learning goals -Basic goals: - Basic JS Syntax - Basics of git - Debugging in VSCode > breakpoints, Watch - -Bonus Goals: - Writing clean code ### Set up From 99c0609f5fc1bca018e2c6619c704a2e17c30d7a Mon Sep 17 00:00:00 2001 From: Claudia Giancola <106391530+claudiaGiancola@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:58:19 +0100 Subject: [PATCH 8/8] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b6e9374..c728225 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ Run this command to run your code: `node fizzbuzz.js` -### Learning goals - +Goals: - Basic JS Syntax - Basics of git - Debugging in VSCode > breakpoints, Watch