Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created September 30, 2021 04:59
Show Gist options
  • Save rust-play/63bc73bf4814016e435443ef9819eec0 to your computer and use it in GitHub Desktop.
Save rust-play/63bc73bf4814016e435443ef9819eec0 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