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-20 22:30

What programming language is this?

Name: Anonymous 2017-11-21 0:49

• A ``dubs'' number is a number of at least two digits, where the last two digits are the same.
Stupid OP doesn't know that any number except 0 and 1 is dubs when the base isn't specified.
Check ``em.

Name: Anonymous 2017-11-21 3:44

>>3
0 is dubs in base 2

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()

Name: Anonymous 2017-11-21 11:25

a small improvement over >>5:
x=input();s="";exec('if not(%d%%%s):s+="%s"\n'*3%(x,'3','fizz',x,'5','bizz',x%100,'11 or x<1',"check'em"));print s.capitalize()

Name: Anonymous 2017-11-21 13:00

>>3,4
ackchyually, there are numbers that are known to be dubsless regardless of base. it was proven that all of them except 6 are prime numbers: https://dis.tinychan.org/read/prog/1458399797/39

still, I assume that Christopher menas dubs/dubsless in base 10

Name: Anonymous 2017-11-21 14:18

>>6
first condition can also be compressed by replacing 'if not' with 'if less than 1':
x=input();s="";exec('if(%d%%%s)<1:s+="%s"\n'*3%(x,'3','fizz',x,'5','bizz',x%100,'11 or x<1',"check'em"));print s.capitalize()

Name: UIJJJJJJJ 2017-11-21 19:49

HGGJJYUYUYUIYUIYUIYUIUIUYIUYIUYIUYIIUYUIIYUIYUYIUYUI

Name: Anonymous 2017-11-22 4:53

So thats the power of autism

Name: Anonymous 2017-11-22 7:09

>>10
how new are you?

Name: Anonymous 2017-11-22 14:04

>>11
How IMAGEREDDIT are you?

Name: Anonymous 2017-11-22 14:39

>>12
not IMAGEREDDIT enough to complain about 'autism' when people post /programming stuff on a /prog/ramming board, /g/ro.

Name: Anonymous 2017-11-22 15:19

>>13
What programming? Most of the board comprises of off-topic shitposting.

Name: Anonymous 2017-11-23 3:18

>implying real programmers need to post programming stuff

Name: Anonymous 2017-11-23 7:30

>>14
so go shit in those threads instead of here
>>15
who are you quoting?

Name: Anonymous 2017-11-23 15:18

>>16
so go shit in those threads
I don't want to add to it, that's what /lounge/ is for.

Name: Anonymous 2017-11-23 19:59

: FIZZBIZZ
DUP 3 MOD
0= IF
." FIZZ "
THEN
DUP 5 MOD
0= IF
." BIZZ "
THEN
DUP 11 MOD 0=
SWAP
DUP 100 MOD 0=
OR IF
." CHECK'EM "
THEN
CR ;

Name: Anonymous 2017-11-23 20:47

>>18
there isn't supposed to be any space between the words

Name: Anonymous 2017-11-23 21:56

>>19
If you remove the space before the " it will fix that

Name: Anonymous 2017-11-24 9:57

>>19

What about letter case, Michel?

Name: Anonymous 2017-11-24 10:08

>>21
does Forth even have lowercase?

Name: Anonymous 2017-11-24 10:28

HAX MY ANUS

Name: Anonymous 2017-11-24 11:23

_,-""""-..__
24 GET!!! |`,-'_. ` ` `` `--'""".
24 GET!!! ; ,' | `` ` ` ` ``` `.
24 GET!!! ,-' ..-' ` ` `` ` `` ` ` |==.
24 GET!!! ,' ^ ` ` `` ` ` `. ; \
24 GET!!! `}_,-^- _ . ` \ ` ` __ ` ; #
`"---"' `-`. ` \---""`.`. `;
\` ; ; `. `,
||`; / / | |
//_;` ,_;' ,_;"

$_=<>;print"$a".$/if($a=ucfirst"check'em"x!($_<1^$_%100%11)."fizz"x!($_%3)."bizz"x!($_%5))

>>11,22
fuck you for stealing my dubs you dirty gypsies

Name: Anonymous 2017-11-24 22:35

>>22
you can output lowercase letters, so
." Test"
will work, but beyond hardcoding it in, I don't think there is a way to convert between one or another.

If you had individual ascii values on the stack, you can use toupper to convert, but there is no way to do that for hardcoded strings.

Name: Cudder !cXCudderUE 2017-11-25 7:59

>>8
127 bytes of Python...

...beaten by 122 bytes of x86 Asm:

B4 0A BA 79 01 CD 21 89 D6 AD 98 99 AC 2C 30 72
07 6B D2 0A 01 C2 EB F4 87 F3 B1 03 B3 64 E8 22
00 92 99 B1 64 F7 F1 92 D4 0A 38 E0 95 75 0A 09
EA BA 6E 01 74 03 CD 21 46 85 F6 74 05 BA 77 01
CD 21 C3 E8 04 00 B3 69 B1 05 92 99 50 F7 F1 85
D2 75 0F B4 09 89 DA CD 21 46 80 4F 05 20 80 4F
0A 20 5A C3 46 69 7A 7A 24 42 69 7A 7A 24 43 68
65 63 6B 27 65 6D 24 0D 0A 24

Name: Anonymous 2017-11-26 8:00

>>26
The size of a byte depends on the machine. Please use the terms ``character'' and ``octet'' instead.
Anyhow, does that 122-byte-long program of x86 run on ARM? My guess is that it does not.

Name: Anonymous 2017-11-27 7:44

>>26
why are you beating a solution that's not winning, Cudder? you're competing in a dick measuring contest just to say that your dick might not be the biggest but it's also not smallest?

Name: Anonymous 2017-11-27 22:59

>>28
you're competing in a dick measuring contest just to say that your dick might not be the biggest but it's also not smallest?

Sounds just about right

Name: Anonymous 2017-12-01 10:51

Actual programming bump

Name: Anonymous 2017-12-01 23:43

More of this, please.

Name: Anonymous 2017-12-02 0:51

>>30-31
Make more of it then. Beggars can't be choosers.

Name: Anonymous 2017-12-02 1:12

More of this, please.

Name: Anonymous 2017-12-02 8:54

More of this, please.

Name: Anonymous 2017-12-02 20:30

$_=get;.say if $_=tc("check'em"x($_≠0&&$_%100%%11)~'fizz'x$_%%3~'bizz'x$_%%5)

Name: Anonymous 2017-12-02 20:49

>>35
h0ly shit

Name: Anonymous 2017-12-03 21:01

>>35
Disgusting.

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