Program 3 NAME TKTKTKT

TODO: Make a version of this with a Vec that returns both the bool and the i32.

SOURCE CODE

fn main() {
  let start = 1;
  let end = 100;
  let splitter = 8;

  for counter in start..=end {
    if should_process(counter, splitter) {
      let how_many_left = count_how_many_left(counter, end);
      println!("at {counter} with {how_many_left} remaining");
    }
  }
}

fn should_process(value1: i32, value2: i32) -> bool {
  if value1 % value2 == 0 {
    true
  } else {
    false
  }
}

fn count_how_many_left(value1: i32, value2: i32) -> i32 {
  value2 - value1
}


CODE RUNNER