Skip to content

Instantly share code, notes, and snippets.

@chop0
Forked from rust-play/playground.rs
Created September 30, 2021 04:59
Show Gist options
  • Save chop0/2cf910e454bb431fe50b3989905f56df to your computer and use it in GitHub Desktop.
Save chop0/2cf910e454bb431fe50b3989905f56df to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn steps(mut a: i128, mut b: i128, mut c: i128, mut d: i128) -> u32 {
let mut i = 0;
while coeffs != (0, 0, 0, 0) {
(a, b, c, d) = ((a - b).abs(), (b - c).abs(), (c - d).abs(), (d - a).abs());
i += 1;
}
i
}
fn main() {
println!("{}", steps(87759737405187146732, 56850658833245721748, 20866, 104564663817187793641,))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment