Other defaults

[?]
Nov 19, 2020, 8:22 PM
Y4AQJ5RDUWK2F4WBVYTWVU6XCUZGL7JYFK34CT7FBMXBJ24ICSHAC

Dependencies

  • [2] USO5PZWO Start with the print function, separate mutable and immutable functions
  • [3] 3H2BGWRG WIP
  • [4] 2USDM5CH WIP for more generic
  • [5] ES2PMPT4 Using structures instead
  • [6] MLUGR2LL Add default impl and some basic plank logic
  • [7] ZJPL7VNQ Separate planks from main
  • [8] CT3VONTO Introduce PLANKMIN and work with the neverending rows
  • [9] C5VVJ5SO Print how many rows
  • [10] UPCMFGXF Print more about the room and define PLAY
  • [11] F3GMCMWT Merge branch 'master' into sovrum
  • [12] VSG6UWDY Can now build floors
  • [13] 5TH3AA46 10 mm extra space

Change contents

  • replacement in src/main.rs at line 7
    [3.3640][3.3640:3669]()
    static PLANKMAX: u32 = 2010;
    [3.3640]
    [3.509]
    //static PLANKMAX: u32 = 2010;
    /// The smallest allowable plank length
    //static PLANKMIN: u32 = 200;
    //static PLANKWIDTH: u32 = 185;
    //static PLAY: u32 = 20;
    //static SAWBLADE: u32 = 10;
    //static ROOMLENGTH: u32 = 3800;
    //static ROOMLENGTH: u32 = 1000;
    //static ROOMDEPTH: u32 = 555;
    //static ROOMDEPTH: u32 = 2800;
    /// The length of a new plank
    //static PLANKMAX: u32 = 2200;
    static PLANKMAX: u32 = 800;
  • replacement in src/main.rs at line 23
    [3.577][3.29:59](),[3.3669][3.29:59](),[3.29][3.29:59]()
    static PLANKWIDTH: u32 = 185;
    [3.577]
    [3.59]
    static PLANKWIDTH: u32 = 100;
  • replacement in src/main.rs at line 27
    [3.33][3.33:64](),[3.64][3.170:199]()
    static ROOMLENGTH: u32 = 1000;
    static ROOMDEPTH: u32 = 555;
    [3.33]
    [3.199]
    static ROOMLENGTH: u32 = 5000;
    static ROOMDEPTH: u32 = 1000;
  • replacement in src/main.rs at line 37
    [3.340][3.340:392]()
    ROOMLENGTH + PLAY,
    ROOMDEPTH + PLAY
    [3.340]
    [3.392]
    ROOMLENGTH,
    ROOMDEPTH
  • replacement in src/main.rs at line 46
    [2.544][2.544:577]()
    floor_print(finished_floor);
    [2.544]
    [3.232]
    floor_print(&finished_floor);
  • edit in src/main.rs at line 48
    [3.233][2.578:645]()
    //println!("Number of rows: {}", finished_floor.rows_count());
  • replacement in src/main.rs at line 50
    [3.355][2.646:720]()
    fn floor_print(floor: Floor) -> () {
    for row in floor.rows().iter() {
    [3.355]
    [2.720]
    fn floor_print(floor: &Floor) -> () {
    let printmax = 100;
    let mut plank_count = 0;
    let mut plank_count_sum = 0;
    for (num, row) in floor.rows().iter().enumerate() {
    plank_count = row.planks_count();
    plank_count_sum += plank_count;
  • replacement in src/main.rs at line 61
    [2.763][2.763:808]()
    println!("plank: {:#?}", plank);
    [2.763]
    [2.808]
    //println!("plank: {:#?}", plank);
    print!("|{:-^10}|", plank.length());
    // Calculate the parts needed for printing
    //let parts = printmax / plank_count as
  • edit in src/main.rs at line 83
    [2.1425]
    [2.1425]
    println!("row: {:#?}", num + 1);
  • edit in src/main.rs at line 87
    [2.1476]
    [2.1476]
    println!("Number of rows: {}", floor.rows_count());
    println!("Number of planks used: {}", plank_count_sum);
  • edit in src/main.rs at line 93
    [3.674]
    [3.1317]
    println!("coverage: {:#?}", floor.get_coverage());