You will be given a String that only contains letters of the English Alphabet, both lowercase and uppercase (ASCII 65-90 and 97-122). Your task is to output the Fizz-Buzzified version of the String.
How to Fizz-Buzzify a String?
Each letter that has an even index in the English alphabet (the alphabet must be 1-indexed:
a->1,b->2,...,z->26
) will be turned intofizz
if it is lowercase andFIZZ
if it is uppercase (f -> fizz, F -> FIZZ
).Each letter that has an odd index in the English alphabet will be turned into
buzz
if it is lowercase, andBUZZ
if it is uppercase (e -> buzz, E -> BUZZ
).Let's have an example, to illustrate the algorithm, using the string
CodeGolf
(spaces added for clarity):"C o d e G o l f" -> "BUZZ buzz fizz buzz BUZZ buzz fizz fizz" ^ ^ ^ ^ ^ ^ ^ ^ 1 1 0 1 1 1 0 0 (1 is odd index, 0 is even index)
If it is more convenient for your language, you may also leave single spaces between the groups (
fizz, buzz, FIZZ, BUZZ
). Hence, a result likefizzBUZZbuzzbuzz
can also be returned asfizz BUZZ buzz buzz
. Other separators are not allowed.
Test Cases:
Input -> Output "egg" -> "buzzbuzzbuzz" "CodeGolf" -> "BUZZbuzzfizzbuzzBUZZbuzzfizzfizz" "Reset" -> "FIZZbuzzbuzzbuzzfizz" "ATOM" -> "BUZZFIZZBUZZBUZZ" "yOuArEgReAt" -> "buzzBUZZbuzzBUZZfizzBUZZbuzzFIZZbuzzBUZZfizz"
Any standard method for I/O can be used.
Default Loopholes apply.
You are only allowed to take input in your language's native String type. The same applies for output.
You can assume that the input will not be empty.
Shortest code in bytes in every language wins. Good Luck and Fizz-Buzz!