Created
August 9, 2016 21:11
-
-
Save yeukhon/8c1a9ce0921f06645d1a7ffd48178381 to your computer and use it in GitHub Desktop.
Tired of Python version? Me too. Recurse Center's coding challenge
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
// Tired of Python version? Me too. | |
fn main() { | |
for x in 1..101 { | |
match(x%3, x%5) { | |
// Most specific has to go first | |
(0, 0) => println!("CracklePop"), | |
(0, _) => println!("Crackle"), | |
(_, 0) => println!("Pop"), | |
(_, _) => { } // do nothing | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment