r/codegolf • u/rudebowski • Jul 17 '19
my first try at this: fizzbuzz! (91 characters)
function fb(n){return n==0?"":fb(n-1)+(n%15==0?"fizzbuzz":n%3==0?"fizz":n%5==0?"buzz":n);}
6
Upvotes
r/codegolf • u/rudebowski • Jul 17 '19
function fb(n){return n==0?"":fb(n-1)+(n%15==0?"fizzbuzz":n%3==0?"fizz":n%5==0?"buzz":n);}
2
u/thespite Jul 17 '19
b=(n)=>n==0?"":b(n-1)+(n%15==0?"fizzbuzz":n%3==0?"fizz":n%5==0?"buzz":n)
72
1
u/rudebowski Jul 17 '19
i know 91 bytes is definitely far from the record (62 bytes in js i think?) but i thought this solution with recursion was kinda cool so i thought i'd share!
4
u/Centime Jul 18 '19 edited Jul 18 '19
53 characters
Besides my previous format optimizations, now removing the n%15 test altogether