Fix printouts of relative lengths
[?]
Mar 24, 2021, 9:44 PM
6ODVKCN4BSPLQJYHHDEZZQACKE5WGVYUWC7IDXN3D3HMBC6RBA7QCDependencies
- [2]
Y4AQJ5RDOther defaults - [3]
ES2PMPT4Using structures instead - [4]
5TH3AA4610 mm extra space - [5]
ZJPL7VNQSeparate planks from main - [6]
MLUGR2LLAdd default impl and some basic plank logic - [7]
CT3VONTOIntroduce PLANKMIN and work with the neverending rows - [8]
VSG6UWDYCan now build floors - [9]
USO5PZWOStart with the print function, separate mutable and immutable functions - [10]
C5VVJ5SOPrint how many rows - [11]
UPCMFGXFPrint more about the room and define PLAY - [12]
2USDM5CHWIP for more generic
Change contents
- edit in src/main.rs at line 1
#![allow(dead_code)] - replacement in src/main.rs at line 21
static PLANKMAX: u32 = 800;static PLANKMAX: u32 = 1900; - replacement in src/main.rs at line 36
println!("Room dimensions: {} x {} mm",ROOMLENGTH,ROOMDEPTH);println!("Room dimensions: {} x {} mm", ROOMLENGTH, ROOMDEPTH); - edit in src/main.rs at line 38
println!("Sawblade size: {} mm", SAWBLADE);println!("Plank width: {} mm", PLANKWIDTH);println!("Plank length: {} mm", PLANKMAX); - edit in src/main.rs at line 47
- edit in src/main.rs at line 50
- edit in src/main.rs at line 52
let mut plank_count = 0; - replacement in src/main.rs at line 55
plank_count = row.planks_count();plank_count_sum += plank_count;plank_count_sum += row.planks_count(); - replacement in src/main.rs at line 58
print!("|{:-^10}|", plank.length());print!("|"); - replacement in src/main.rs at line 60
// Calculate the parts needed for printing//let parts = printmax / plank_count as// Print half the relative length of the plankfor _ in 0..(plank.length() / printmax) / 2 {print!("-");} - edit in src/main.rs at line 65
// Print the numeric lengthprint!("{:-^5}", plank.length()); - replacement in src/main.rs at line 68
/*if planklist[x].0 == ROOMLENGTH {println!("|{:-^22}|", ROOMLENGTH);} else {// If x is oddif planklist[x].0 == planklist[x].1 {println!("|{:-^10}||{:-^10}|", planklist[x].0, planklist[x].1)} else if planklist[x].0 < planklist[x].1 {println!("|{:-^7}||{:-^13}|", planklist[x].0, planklist[x].1)} else {println!("|{:-^13}||{:-^7}|", planklist[x].0, planklist[x].1)}// Print the rest of the plank including the endfor _ in 0..(plank.length() / printmax) / 2 {print!("-"); - replacement in src/main.rs at line 72
*/print!("|"); - replacement in src/main.rs at line 84
println!("coverage: {:#?}", floor.get_coverage());//println!("coverage: {:#?}", floor.get_coverage());