Skip to content

Instantly share code, notes, and snippets.

@GEverding
Created April 5, 2013 02:59
Show Gist options
  • Save GEverding/5316270 to your computer and use it in GitHub Desktop.
Save GEverding/5316270 to your computer and use it in GitHub Desktop.
Fun Example of FizzBuzz in Rust
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