Created
September 4, 2017 20:00
-
-
Save arthurbailao/0c442a7e99fc53e5e7dae213017b0814 to your computer and use it in GitHub Desktop.
Quiz
This file contains 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
class Integer; alias ๐ upto; alias ๐ +; alias ๐ -; alias ๐ /; end | |
class Proc; alias ๐ call; end | |
module Kernel; alias ๐จ puts; def ๐ฏ; 100 end; end | |
โ = ๐ฏ.๐ ๐ฏ | |
๐ = ๐ฏ.๐ ๐ฏ | |
๐ค = ๐.๐ ๐ | |
๐ = ๐ค.๐ ๐ | |
๐ = ๐.๐ ๐ค | |
๐ค = -> (๐ฉ) { | |
๐ = if ๐ฉ % ๐ == โ && ๐ฉ % ๐ == โ | |
"๐บ๐" | |
elsif ๐ฉ % ๐ == โ | |
"๐บ" | |
elsif ๐ฉ % ๐ == โ | |
"๐" | |
else | |
๐ฉ | |
end | |
๐จ ๐ | |
} | |
๐.๐(๐ฏ) { |๐ป| ๐ค.๐(๐ป) } |
Acho que a analogia รฉ cerveja = "fizz" e abelha = "buzz".
Muito legal a utilizaรงรฃo de unicode no Ruby, e todo esse monkey patching!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pelo que eu pude entender, ele estรก percorrendo do nรบmero 1 ao 100 e imprimindo:
1. Caneca e abelha, se o valor atual for divisรญvel por 5 e por 3.
2. Caneca, se for divisรญvel apenas por 3.
3. Abelha, se for divisรญvel apenas por 5.
4. Imprime o prรณprio nรบmero se as demais condiรงรตes nรฃo forem as corretas.