Skip to content

Instantly share code, notes, and snippets.

@yeukhon
Created August 9, 2016 21:11
Show Gist options
  • Save yeukhon/8c1a9ce0921f06645d1a7ffd48178381 to your computer and use it in GitHub Desktop.
Save yeukhon/8c1a9ce0921f06645d1a7ffd48178381 to your computer and use it in GitHub Desktop.
Tired of Python version? Me too. Recurse Center's coding challenge
// 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