Skip to content

Instantly share code, notes, and snippets.

@drewstaylor
Last active August 4, 2021 19:55
Show Gist options
  • Save drewstaylor/b3992be449b1028854acf2ef4051047b to your computer and use it in GitHub Desktop.
Save drewstaylor/b3992be449b1028854acf2ef4051047b to your computer and use it in GitHub Desktop.
SATOSHI'S LOST FAUCET - Genesis Exhibit (-50n shills)
/**
* Leonard is having trouble with his program, but the flame is its own reflection. Perhaps his coding skills are just rusty.
* Do you have the patience and memory capacity to compute this simplest of equations? Shouldn't human brain power be enough?
*/
fn make(n: u32) -> u32 {
match n {
0 => 1,
1 => 1,
_ => make(n-1) + make(n-2),
}
}
fn main() {
let control: u32 = 11111111;
let length: u32 = 50;
let mut i: u32 = 0;
println!("Which {:?} is real?", control);
while i < length {
let power: u32 = make(i);
println!("{:?}: {:?}", i+1, power*control);
i += 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment