Created
April 5, 2013 02:59
-
-
Save GEverding/5316270 to your computer and use it in GitHub Desktop.
Fun Example of FizzBuzz in Rust
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 int::range(1, 101) |x| { | |
match ( x % 3, x % 5) { | |
(0, 0) => io::println("fizbuzz"), | |
(0, _) => io::println("fizz"), | |
(_, 0) => io::println("buzz"), | |
(_, _) => io::println(x.to_str()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment