3 ms·
Ruby has the added bonus of Flip Flops to make everything even more opaque! a=b=c=(1..100).each do |num| print num, ?\r, ("Fizz" unless (a =
by a_bonobo 12y ago
Ruby has the added bonus of Flip Flops to make everything even more opaque!
a=b=c=(1..100).each do |num|
print num, ?\r,
("Fizz" unless (a = !a) .. (a = !a)),
("Buzz" unless (b = !b) ... !((c = !c) .. (c = !c))),
?\n
end
Add comments as needed
Source: http://www.reddit.com/r/ruby/comments/2n987g/the_flip_flop_operator_in_ruby/cmbiwt8 http://www.reddit.com/r/ruby/comments/2n987g/the_flip_flop_o...