Cleanup old code

[?]
Jul 11, 2020, 9:44 PM
ZJUC65PX5MUE2YQZGFHBSHJYLJRAUAII3FIUFABO4KB6G3KGPENQC

Dependencies

  • [2] RQRFFUF6 Can build the first basic row
  • [3] MLUGR2LL Add default impl and some basic plank logic
  • [4] 5TH3AA46 10 mm extra space
  • [5] 2USDM5CH WIP for more generic
  • [6] ES2PMPT4 Using structures instead

Change contents

  • edit in src/main.rs at line 112
    [3.1494][3.1494:1497](),[3.1497][2.198:396](),[2.396][3.1497:1583](),[3.1497][3.1497:1583]()
    /*
    //let mut leftover = 0;
    //let mut coverage = 0;
    //let mut plankcount = 0;
    //let mut rowlist: Vec<Vec<Plank>> = vec![];
    //println!("First plank length: {}", PLANKMAX - leftover);
    while coverage < ROOMDEPTH {
    // Create new plank vector
    let mut row = vec![];
  • edit in src/main.rs at line 113
    [3.645][3.1584:2027](),[3.1324][3.746:747](),[3.2027][3.746:747](),[3.746][3.746:747](),[3.747][3.2028:2206](),[3.1667][3.964:965](),[3.2206][3.964:965](),[3.964][3.964:965](),[3.965][3.2207:2513](),[3.1801][3.1077:1078](),[3.2513][3.1077:1078](),[3.1077][3.1077:1078](),[3.1078][3.2514:2625](),[3.1846][3.1078:1088](),[3.2625][3.1078:1088](),[3.1078][3.1078:1088](),[3.1874][3.1088:1089](),[3.1088][3.1088:1089](),[3.1089][3.2626:2666](),[3.2666][3.1257:1263](),[3.1257][3.1257:1263](),[3.1263][3.2667:2866](),[3.1913][3.1323:1324](),[3.2866][3.1323:1324](),[3.1323][3.1323:1324]()
    let mut rowfilled = 0;
    while rowfilled < ROOMLENGTH {
    // Length of the plank is greater than the remainder room
    if ROOMLENGTH - rowfilled > PLANKMAX {
    // If this is the first plank
    let end = rowfilled == 0;
    // Store the full length plank
    row.push(Plank {
    length: PLANKMAX,
    endpiece: end,
    });
    rowfilled += PLANKMAX;
    // For each iteration, we have used another plank
    plankcount += 1;
    // If a whole plank was used, the leftover is 0
    leftover = 0;
    // Length of the plank is smaller than the room
    } else {
    // Add the remainder
    let remainder = ROOMLENGTH - rowfilled;
    row.push(Plank {
    length: remainder,
    endpiece: true,
    });
    rowfilled += remainder;
    // Calculate the leftover plank length
    leftover = PLANKMAX - (ROOMLENGTH - rowfilled);
    }
    let mut leftoverold = leftover;
    }
    rowlist.push(row);
    // How much of the floor have been covered?
    coverage += PLANKWIDTH;
    }
    */
    //println!("\nTotal amount of planks: {}\n", plankcount);
    //println!("\n: {:#?}\n", rowlist);