Created
September 14, 2017 15:56
-
-
Save nilsmartel/1b6cc7cf3f5489fc817b779ad139a845 to your computer and use it in GitHub Desktop.
Fibonacci in Rust (Testing out Gist)
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() { | |
fib(0, 1, 75); | |
} | |
fn fib(a: u64, b: u64, count: u32) { | |
println!("{}", a); | |
if count > 0 { | |
fib(b, a+b, count-1); | |
} else { | |
println!("{}", b); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment