Type: | Package |
Title: | Fizz Buzz Implementation |
Version: | 0.1.1 |
Date: | 2016-10-26 |
Description: | An implementation of the Fizz Buzz algorithm, as defined e.g. in https://en.wikipedia.org/wiki/Fizz_buzz. It provides the standard algorithm with 3 replaced by Fizz and 5 replaced by Buzz, with the option of specifying start and end numbers, step size and the numbers being replaced by fizz and buzz, respectively. This package gives interviewers the optional answer of "I use fizzbuzzR::fizzbuzz()" when interviewing rather than having to write an algorithm themselves. |
License: | GPL (≥ 3) |
LazyData: | TRUE |
Depends: | R (≥ 3.1.0) |
RoxygenNote: | 5.0.1 |
NeedsCompilation: | no |
Packaged: | 2016-10-27 09:27:05 UTC; ansgar |
Author: | Ansgar Wenzel [aut, cre] |
Maintainer: | Ansgar Wenzel <ansgar.wenzel+fizzbuzzR@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2016-10-27 17:40:26 |
This is an implementation of the fizzbuzz algorithm with several parameters
Description
This function calculates fizzbuzz as is often asked in interviews. This gives interviewees the alternative answer of 'I use fizzbuzzR::fizzbuzz() with standard options'
Usage
fizzbuzz(start = 1, end = 20, step = 1, mod1 = 3, mod2 = 5)
Arguments
start |
The start of the for loop |
end |
Tast number of the for loop |
step |
The step size of the for loop |
mod1 |
mod1 is the number replaced with fizz |
mod2 |
mod2 is the number replaced by Buzz |
Value
Fizzbuzz simply prints the numbers, replaced with fizz/buzz as required, to the screen.
References
[wiki]https://en.wikipedia.org/wiki/Fizz_buzz
Examples
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
fizzbuzz()