Created
March 24, 2021 23:55
-
-
Save heyajulia/e9fbe8eac8a992d689840d235ab74b57 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
// This strange code came to me in a dream. | |
fn main() { | |
for n in 1..20 { | |
println!( | |
"{}", | |
match (n % 3 == 0, n % 5 == 0) { | |
(true, false) => "Fizz".to_string(), | |
(false, true) => "Buzz".to_string(), | |
(true, true) => "FizzBuzz".to_string(), | |
(false, false) => n.to_string(), | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment