Skip to content

Instantly share code, notes, and snippets.

@nilsmartel
Created September 14, 2017 15:56
Show Gist options
  • Save nilsmartel/1b6cc7cf3f5489fc817b779ad139a845 to your computer and use it in GitHub Desktop.
Save nilsmartel/1b6cc7cf3f5489fc817b779ad139a845 to your computer and use it in GitHub Desktop.
Fibonacci in Rust (Testing out Gist)
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