Created
June 20, 2014 14:07
-
-
Save eightbitraptor/ae8115538b35300f1e90 to your computer and use it in GitHub Desktop.
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
fn main() { | |
for number in range(1,101) { | |
let output = match number { | |
x if x % 5 == 0 && x % 3 == 0 => { "FizzBuzz".to_str() } | |
x if x % 5 == 0 => { "Buzz".to_str() } | |
x if x % 3 == 0 => { "Fizz".to_str() } | |
x @ _ => { x.to_str() } | |
}; | |
println!("{}", output); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Thiez Fair enough. :)