-
-
Save j-manu/3245362 to your computer and use it in GitHub Desktop.
Writing FizzBuzz with flip-flops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment