Aliens have struck once again! The situation is dire, for they have the technological advantage, but we still have the better programmers! Our spearhead phishing attacks (it turns out that aliens fall for cat videos as much as we do) have allowed our experts to identify a weakness in their computer systems. Their computations are extremely parallel, and the myriads of concurrent routines rely heavily on monotonically increasing sequences to keep them from corrupting shared data. The routine that generates these sequences is a single point of failure. We plan to surreptitiously replace it with a version that outputs flawed sequences, leading to a failure cascade in their systems.
To evade the self-repair protocols in their systems, the new routine must produces sequences that are at the same time close enough to the original and weird enough to cause a failure. Our experts have determined that the FizzBuzz algorithm has the highest probability for success. There is one catch, though – the algorithm has to be written in a programming language that is understood by the alien systems. The good news is that the aliens have long since recognized that Ruby is the most elegant language in the universe and are using it in all of their systems. The bad news is that due to cognitive differences with humanity, the aliens find vowels distasteful, so their Ruby interpreters will not parse any source code which contains vowels.
As one of the top coders in the Terran force, you are called upon to save humanity by writing a
FizzBuzz program without using any vowels. The program should define a variable named fzbz
that
responds to a call
message. The call
method should accept a single number as input. Its output
should be an array containing the FizzBuzz sequence from 1 to the input number. The FizzBuzz sequence
is defined as the numbers from 1 to n with the following modifications:
"Fizz"
."Buzz"
."FizzBuzz"
.Example:
fzbz.call 15 # => [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz"]
The lower the score - the better. It is the shortest solution that wins.
Rank: 1
Nickname: pesho
Score: 69
fzbz = g = -> n { n < 1 ? [] : g[n - 1] + [ [ % %sB\x75zz % x=[% F\x69zz ][n%3] ][n%5] || x || n ] }
Rank: 1
Nickname: J&T
Score: 69
🤯 = fzbz = -> 🤘 { 🤘 < 1 ? [] : 🤯[🤘-1] + [[% %sB\165zz % 🤣=[% F\151zz ][🤘%3]][🤘%5] || 🤣 || 🤘] }
Rank: 3
Nickname: halfbyte
Score: 71
fzbz = f = ->c { c > 0 ? f[c - 1] + [["%sB\x75zz"%x=%W(F\x69zz)[c%3]][c%5]||x||c] : [] }
Rank: 4
Nickname: vizvamitra
Score: 72
q = fzbz = -> n, *r { n < 1 ? r : q[n-1,[% %sB\x75zz %s=[% F\x69zz ][n%3]][n%5]||s||n,*r] }
Rank: 5
Nickname: Gosho337
Score: 75
fzbz=g=->n{ s= n%3<1 ? % F%czz %105 : % n>0 ? g.(n-1) + [n%5<1 ? s+% B%czz %117 : s>% ? s : n] : [] }
Rank: 6
Nickname: akseniyap
Score: 83
fzbz = f = ->c { c > 0 ? f[c - 1] + [(k = "#{c%3>0?'':"F\x69zz"}#{c%5>0?'':"B\x75zz"}") > '' ? k : c] : [] }
Rank: 6
Nickname: Jure
Score: 83
fzbz = -> n { n > 0 ? fzbz.(n - 1) + [["%sB#{117.chr}zz" % x = [?F<<105<<'zz'][n % 3]][n % 5] || x || n] : [] }
Rank: 8
Nickname: meerkat
Score: 85
fzbz = f = -> x, n = 1 { s = (n % 3 > 0 ? '' : "F\151zz") + (n % 5 > 0 ? '' : "B\165zz") n > x ? [] : [s > '' ? s : n] + f[x, n + 1] }
Rank: 9
Nickname: papabear
Score: 87
fzbz = -> n { n==0 ? [] : fzbz[n - 1] + [["%sB#{117.chr}zz" % (x=["F#{105.chr}zz"][n%3])][n%5]||x||n] }
Rank: 9
Nickname: Cindro
Score: 87
fzbz = ->(n) { n > 0 ? fzbz.(n - 1) + [["%sB#{117.chr}zz" % x = ["F#{105.chr}zz"][n % 3]][n % 5] || x || n] : [] }
Rank: 11
Nickname: svetlio
Score: 89
F = "F%czz" % 105 B = "B%czz" % 117 fzbz = -> (x) { f = x % 5 == 0 x > 0 ? fzbz[x - 1] + [x % 3 == 0 ? ( f ? F + B : F) : ( f ? B : x)] : [] }
Rank: 12
Nickname: mediafinger
Score: 90
fzbz =-> (n) { b="B\x75zz" f="F\x69zz" n > 0 ? fzbz[n-1] + [( n%15 == 0 ? f+b : ( n%5 == 0 ? b : ( n%3 == 0 ? f :n ) ) )] : [] }
Rank: 13
Nickname: rmosolgo
Score: 91
g = fzbz = ->x { l = "zz" z = (x % 3 < 1 ? ?F + 105.chr + l : "") + (x % 5 < 1 ? ?B + 117.chr + l : "") x < 1 ? [] : g[x - 1] + [z > "" ? z : x] }
Rank: 14
Nickname: ssk
Score: 92
fzbz = -> _ { _ < 1 ? [] : fzbz[_ - 1] + [_ % 3 * _ % 5 > 0 ? _ : (_ % 3 < 1 ? % F#{105.chr}zz : '') + (_ % 5 < 1 ? % B#{117.chr}zz : '')] }
Rank: 14
Nickname: Upnext
Score: 92
fzbz = ->(n, r = []) { z = n % 3 < 1 ? "F\x69zz" : "" z += n % 5 < 1 ? "B\x75zz" : "" z == "" && z = n r = [z] + r n > 1 ? fzbz[n-1, r] : r }
Rank: 16
Nickname: redzhep
Score: 97
fzbz = -> n, x = 1, z = [] { x % 3 < 1 && s = "F#{105.chr}zz" x > n ? z : fzbz.(n, x + 1, z << (x % 5 < 1 ? "#{s}B#{117.chr}zz" : s || x)) }
Rank: 17
Nickname: rb-bikezilla
Score: 99
fzbz = y = -> (_, r = []) { f = "F#{105.chr}zz" b = "B#{117.chr}zz" _ > 0 ? y.(_-1, [_%15 > 0 ? _%5 > 0 ? _%3 > 0 ? _ : f : b : f+b] + r) : r }
Rank: 18
Nickname: 🥩
Score: 102
fzbz = ->(n, l = 1, r = []) { r += [["%sB#{117.chr}zz"%x=["F#{105.chr}zz"][l%3]][l%5]||x||l] n == l ? r : fzbz.(n, l + 1, r) }
Rank: 19
Nickname: mykhi
Score: 116
f = "F%czz" % 105 b = "B%czz" % 117 fzbz = ->(n,r = []) { r = ( n % 15 == 0 ) ? [f+b] + r : (n % 3 == 0) ? [f] + r : (n % 5 == 0) ? [b] + r : [n] + r n != 1 ? fzbz[n-1, r] : r }
Rank: 20
Nickname: rb-angel
Score: 122
F = {0 => 'B%czz'%117}; T = {0 => 'F%czz'%105}; FT = {0 => "#{T[0]}#{F[0]}"} fzbz = ->(n) { n == 0 ? [] : fzbz.(n-1) + [FT[n%15] || T[n%3] || F[n%5] || n] }
Rank: 21
Nickname: mykhi2
Score: 124
f = "F%czz" % 105 b = "B%czz" % 117 x = {3 => f, 5 => b} fzbz = ->(n, r=[]) { z = n % 3 == 0 ? x[3] : "" z += n % 5 == 0 ? x[5] : "" z == "" && z = n r = [z] + r n != 1 ? fzbz[n-1, r] : r }