Welcome to FancyFizzBuzz!, version 0.0.1

Fancy FizzBuzz is an overengineered version of the "FizzBuzz" program. By default, it prints numbers, except it replaces multiples of 3 with "Fizz!", multiples of 5 with "Buzz!", and multiples of both with "FizzBuzz!"

But we believe anything not worth doing is worth doing well, so Fancy FizzBuzz:

Takes command line parameters

Takes custom modulos (instead of 3 and 5)

Takes custom outputs (instead of "Fizz" and "Buzz")

Can output to a file

This was done as part of a small challenge, but I honestly would like to see how far the open source community can take Fancy FizzBuzz to become the most overly engineered version of the simple "FizzBuzz" program out there.

$ npm run build

Command Line Usage (from root directory of this project):

$ node build/main.js <first> <last> (-h, -v) [-i <filename>] [-o <filename>] [-m <first modulus> <second modulus>] [-t “<first term>” “<second term>”] where <first> and <last> are integers.

For integers larger than 9007199254740991 or less than -9007199254740991, be sure to write your numbers as strings from the command line, by putting them in quotes. Javascript can only handle numbers between -(2^53-1) and (2^53-1), so any number outside that range must be entered as a string.

Other parameters: (case insensitive) node index.js -h (or -help) => Read this help document node index.js -v (or -version) => Get version info node index.js -i (or -input) [filename] => Input min and max from text file. This must be in the form "#, #" (This is a fairly useless feature but can be expanded to include JSON parameters for fine tuning on later features) node index.js -o (or -output) [filename] => Output to file, instead of console node index.js -m (or -moduli) [fizz modulus] [buzz modulus] => Define the string replacement conditions; Defaults are 3 and 5, respectively. Example: $ node index.js 1 10 -m 2 5 => “1, Fizz!, 3, Fizz!, Buzz!, Fizz!, 7, Fizz!, 9, FizzBuzz!” node index.js -t (or -terms) [fizz term] [buzz term] => Redefine the strings to replace integers with Example: $ node index.js 1 7 -t “Foo” “Bar” => “1, 2, Foo!, 4, Bar!, 7”

Node Package Usage

ES6: import {createFizzBuzz as fizzBuzz} from './lib/index' ES5: var fizzBuzz = require('./lib/index').createFizzBuzz

fizzBuzz(start, end, [firstMod, secondMod, firstModOutput, secondModOutput]) returns array start: number to start the sequence (inclusive); Integer, Required end: Integer, number to end the sequence (inclusive); Integer, Required firstMod: First modulus number Integer Default 3 secondMod: Second modulus number Integer Default 5 firstModOutput: First replacement string. String Default "Fizz" secondModOutput: Second replacement string. String Default "Buzz"

12 MARCH 2016:

Fizzbuzz now works with numbers < -(2^53 - 1) and > (2^53 - 1), as per instructions;

Fixed bug where calling FizzBuzz with the -h or -v flag will show a warning message.

Discovered and fixed a bug where it was incorrectly shunting to process all integers as big integers, this was inefficient but did not affect functionality.

Fixing that bug caused me to discover a bug the tests did not pick up where a variable was misnamed. Fixed.

Still to do:

Add responsive features so that user can quit from the command line.

6 MARCH 2016:

These are completed features: