Initial attempt to not get too short planks at end of row

AfoHT
Jan 26, 2024, 8:48 PM
NJC3HBR6NJRXVFZ7EVFGN4TVXVMH2K5XMUGVE2NG3ES6DN5U7MRAC

Dependencies

  • [2] E6F2AEXP Fix floorbuilding
  • [3] WT7LSRGI Each Row stores its maximum length
  • [4] CT3VONTO Introduce PLANKMIN and work with the neverending rows
  • [5] C5VVJ5SO Print how many rows
  • [6] ZJPL7VNQ Separate planks from main
  • [7] JPTYS433 Cleanup, clippy
  • [8] 4YYL4VTY Introduce Cut
  • [9] MLUGR2LL Add default impl and some basic plank logic
  • [10] Q7IWKL57 Calculate required length once and reuse
  • [*] 5TH3AA46 10 mm extra space

Change contents

  • replacement in src/bin/main.rs at line 98
    [2.877][3.1113:1186](),[3.4040][3.1113:1186]()
    let required_length = row.get_max_length() - row.get_coverage();
    [2.877]
    [3.1186]
    let mut required_length = row.get_max_length() - row.get_coverage();
    println!("Required length: {}", required_length);
    if required_length <= PLANKMIN {
    // try to redo previous plank
    // Remove previous plank
    println!("Removing plank");
    row.pop(ms);
    // Calculate new required length but divide by two
    required_length = (row.get_max_length() - row.get_coverage()) / 2;
    }