From 685eeb9de9ce6faeda1984eeac75a2681ece4810 Mon Sep 17 00:00:00 2001 From: Divlo Date: Wed, 30 Jun 2021 13:35:03 +0200 Subject: [PATCH] feat(challenges): add `fizzbuzz` --- challenges/fizzbuzz/README.md | 34 +++++ challenges/fizzbuzz/solutions/.gitkeep | 0 challenges/fizzbuzz/test/1/input.txt | 1 + challenges/fizzbuzz/test/1/output.txt | 5 + challenges/fizzbuzz/test/2/input.txt | 1 + challenges/fizzbuzz/test/2/output.txt | 200 +++++++++++++++++++++++++ 6 files changed, 241 insertions(+) create mode 100644 challenges/fizzbuzz/README.md create mode 100644 challenges/fizzbuzz/solutions/.gitkeep create mode 100644 challenges/fizzbuzz/test/1/input.txt create mode 100644 challenges/fizzbuzz/test/1/output.txt create mode 100644 challenges/fizzbuzz/test/2/input.txt create mode 100644 challenges/fizzbuzz/test/2/output.txt diff --git a/challenges/fizzbuzz/README.md b/challenges/fizzbuzz/README.md new file mode 100644 index 0000000..34f890f --- /dev/null +++ b/challenges/fizzbuzz/README.md @@ -0,0 +1,34 @@ +# fizzbuzz + +Created by [@Divlo](https://github.com/Divlo) on 30 June 2021. + +## Instructions + +Write a program that print the numbers from 1 to `n` but: + +- if number is divisible by 3, print `Fizz` +- if number is divisible by 5, print `Buzz` +- if number is divisible by both 3 and 5, print `FizzBuzz` +- otherwise print the number + +## Examples + +### Example 1 + +#### Input + +```txt +5 +``` + +#### Output + +```txt +1 +2 +Fizz +4 +Buzz +``` + +See the `test` folder for examples of input/output. diff --git a/challenges/fizzbuzz/solutions/.gitkeep b/challenges/fizzbuzz/solutions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/challenges/fizzbuzz/test/1/input.txt b/challenges/fizzbuzz/test/1/input.txt new file mode 100644 index 0000000..7813681 --- /dev/null +++ b/challenges/fizzbuzz/test/1/input.txt @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/challenges/fizzbuzz/test/1/output.txt b/challenges/fizzbuzz/test/1/output.txt new file mode 100644 index 0000000..a0ab0b2 --- /dev/null +++ b/challenges/fizzbuzz/test/1/output.txt @@ -0,0 +1,5 @@ +1 +2 +Fizz +4 +Buzz \ No newline at end of file diff --git a/challenges/fizzbuzz/test/2/input.txt b/challenges/fizzbuzz/test/2/input.txt new file mode 100644 index 0000000..ae4ee13 --- /dev/null +++ b/challenges/fizzbuzz/test/2/input.txt @@ -0,0 +1 @@ +200 \ No newline at end of file diff --git a/challenges/fizzbuzz/test/2/output.txt b/challenges/fizzbuzz/test/2/output.txt new file mode 100644 index 0000000..310b137 --- /dev/null +++ b/challenges/fizzbuzz/test/2/output.txt @@ -0,0 +1,200 @@ +1 +2 +Fizz +4 +Buzz +Fizz +7 +8 +Fizz +Buzz +11 +Fizz +13 +14 +FizzBuzz +16 +17 +Fizz +19 +Buzz +Fizz +22 +23 +Fizz +Buzz +26 +Fizz +28 +29 +FizzBuzz +31 +32 +Fizz +34 +Buzz +Fizz +37 +38 +Fizz +Buzz +41 +Fizz +43 +44 +FizzBuzz +46 +47 +Fizz +49 +Buzz +Fizz +52 +53 +Fizz +Buzz +56 +Fizz +58 +59 +FizzBuzz +61 +62 +Fizz +64 +Buzz +Fizz +67 +68 +Fizz +Buzz +71 +Fizz +73 +74 +FizzBuzz +76 +77 +Fizz +79 +Buzz +Fizz +82 +83 +Fizz +Buzz +86 +Fizz +88 +89 +FizzBuzz +91 +92 +Fizz +94 +Buzz +Fizz +97 +98 +Fizz +Buzz +101 +Fizz +103 +104 +FizzBuzz +106 +107 +Fizz +109 +Buzz +Fizz +112 +113 +Fizz +Buzz +116 +Fizz +118 +119 +FizzBuzz +121 +122 +Fizz +124 +Buzz +Fizz +127 +128 +Fizz +Buzz +131 +Fizz +133 +134 +FizzBuzz +136 +137 +Fizz +139 +Buzz +Fizz +142 +143 +Fizz +Buzz +146 +Fizz +148 +149 +FizzBuzz +151 +152 +Fizz +154 +Buzz +Fizz +157 +158 +Fizz +Buzz +161 +Fizz +163 +164 +FizzBuzz +166 +167 +Fizz +169 +Buzz +Fizz +172 +173 +Fizz +Buzz +176 +Fizz +178 +179 +FizzBuzz +181 +182 +Fizz +184 +Buzz +Fizz +187 +188 +Fizz +Buzz +191 +Fizz +193 +194 +FizzBuzz +196 +197 +Fizz +199 +Buzz \ No newline at end of file