WDI Fundamentals Unit 8
In the exercise for the conditionals lesson, FizzBuzz, we wrote code that took an input,
x, and set a new
result value according to a specific set of rules.
This time, your challenge is to loop through every number from 1 to
max, applying those exact same rules to each number and, before ending the loop, printing the result out in the console using the command
For reference, if
max is 20, the following should be displayed in the console:
1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz
Testing any number less than 20 should give you a subset of that result — in other words, if
max is 5, we get the following:
1 2 fizz 4 buzz
Stuck? Check out the solutions to see what you can do.
Feeling confident? On to the quiz!