Skip to content

Modified fizzbuzz classic coding challenge with added prime number logics

Notifications You must be signed in to change notification settings

ZachDischner/FizzBuzz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Buzz Fizz

My solution to the modified fizzbuzz classic posed by SwiftNav at https://github.com/swift-nav/screening_questions/blob/master/questions.md#swift-navigation-application-questions

  • "Buzz" when F(n) is divisible by 3.
  • "Fizz" when F(n) is divisible by 5.
  • "FizzBuzz" when F(n) is divisible by 15.
  • "BuzzFizz" when F(n) is prime.
  • the value F(n) otherwise.

Run me

Simple! Just run from the command line with a Python 2/3 interpreter. Optional --debug argument will print out the Fibonacci sequence number, the actual fibonacci number, as well as the fizzbuzzed encoding.

python fizzbuzz.py 12

Imgur

Env

Dependencies and requirements are pretty minimal, and you can create your own setup with your very own custom made Anaconda environment using the included environment.yml file. (http://conda.pydata.org/docs/using/envs.html)

conda env create -f environment.yml
source activate fizzbuzz

Imgur

Tests

Tests are included in a combo of doctest strings for expressionable verifiers, and pytest tests for more involved functionality tests. Both can be ran through the pytest utility. If all goes well, you should see minimal output.

pytest --doctest-modules fizzbuzz.py
pytest fizzbuzz.py

Imgur

About

Modified fizzbuzz classic coding challenge with added prime number logics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages