Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ Challenge #420: FizzBizzPlizzPlizz

Name: Christopher 2017-11-20 20:52

Since we seem to enjoy inane memes and toy programs, let's combine both.

Your task is to write a program, which will read an integer from the standard input. If the number is a multiple of 3, the program will print ``
Fizz
'' to standard output. If the number is a multiple of 5, the program will print ``
Bizz
'' (sic) to standard output. If the number is a dubs number, the program will print ``
Check'em
'' to standard output. In any case, the output should be terminated with a newline.

• Output is case-sensitive
• In case a number fulfils multiple criteria, all the matching strings should be printed, with no characters in between. In every string except the initial, convert the first letter to lowercase, thus achieving one capitalized word. Order of strings is arbitraty.
• You may assume that the input will be a numeric string between 0 and 6001.
• A ``dubs'' number is a number of at least two digits, where the last two digits are the same.
• For numbers not matching any of the above criteria, do nothing.

Test cases:

0 -> Fizzbizz
1 -> (no output)
2 -> (no output)
3 -> Fizz
15 -> Fizzbizz (or Bizzfizz)
333 -> Fizzcheck'em (or Check'emfizz)
600 -> Check'emfizzbizz (or other combinations)

Shortest program wins. Good luck!

Name: Anonymous 2017-11-21 11:14

FIOC2:
x=input();s="";exec('if not(%d%%%s):s+="%s"\n'*3%(x,'3','fizz',x,'5','bizz',x%100,'11 or x==0',"check'em"));print s.capitalize()

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List