Created
August 8, 2016 21:45
-
-
Save sentientmonkey/1e49533d02ab203483f2e14f209f5b59 to your computer and use it in GitHub Desktop.
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
pub fn raindrops(n: u64) -> String { | |
match (n % 3, n % 5, n % 7) { | |
(0, 0, 0) => "PlingPlangPlong".to_string(), | |
(0, 0, _) => "PlingPlang".to_string(), | |
(0, _, 0) => "PlingPlong".to_string(), | |
(_, 0, 0) => "PlangPlong".to_string(), | |
(0, _, _) => "Pling".to_string(), | |
(_, 0, _) => "Plang".to_string(), | |
(_, _, 0) => "Plong".to_string(), | |
(_, _, _) => n.to_string(), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment