4YYL4VTYM7SVQG5KUT6AJHMABLCOC4LQESBUWHUZ7OQCKJTM4MAQC
LXMNVVD2EZ4YK7KTC6VK2I5RCHX7RMBGPTLQYRYJ7TSCZTNUO7ZAC
Q7IWKL57OWTZL2FQVVC6WH7DCYQYXOLEBFZIZFSRBK7A6K4ZGZDAC
JCYHD3FDWJK6GA22WBUJ6NF254ZAOYOZ3VZSIGVFS2NFKMTAATXAC
OK5CKW6E72XAZTRJUWSKFPJBPZYNIWQGVXFR5ARSJHB6EIBMU6WQC
JPTYS433ESGA2UUNKQT4JMAWFU7KVIU7F5RKDZTUR7RR5A2COBVQC
ZJPL7VNQEYASQ7QIUCR3X2IPWF5MAR6WX7VY6OWMRDMPJK7GYWIAC
B75B3UUKURXWL6VBIJK3IKNDBH6MOLECYDOZR5LSQQILVMKFMIAAC
VSG6UWDYMGCJHOVD5BI5UNAAYLVL6REAAJLI7OXUGCSXLJZTV36QC
C5VVJ5SOXXMIWNHCY4BLV5JOXDLDSFGP5QI7WWB74XIZ4JJMIBVAC
5TH3AA466T4JIICGT3LTLJ554X62KF36XZUXKR5MIAXVWAGQQHWQC
SMYRM2CFBM7BJYHAUIJYTSORS2V6O5GAHRSY2K6ELGOM3OF5VHCQC
pub fn get_cut_coordinates(&self) -> Vec<Cut> {
return self.cut_coordinates.clone();
}
pub fn check_if_cut_is_valid(&self, new_cut: Cut) -> bool {
// If we have no cuts, no need to check them
if !self.cut_coordinates.is_empty() {
for cut in &self.cut_coordinates {
println!("Cut coordinate {}", cut.coordinate);
if cut.coordinate.abs_diff(new_cut.coordinate) < CUTADJACENCY {
// Invalid, cut is too close!
return false;
}
}
}
return true;
}
let required_length = ROOMLENGTH - row.get_coverage();
let required_length = row.get_max_length() - row.get_coverage();
if let Some(adjacent_row) = adjacent_row {
println!("Cut coordinates: {:?}", row.get_cut_coordinates());
// Check if the new plank lands too close to a previous cut
// Or a new one
if !adjacent_row.check_if_cut_is_valid(Cut::new(required_length)) {
println!("Invalid cut at {required_length}!!! Handle this");
} else if !adjacent_row.check_if_cut_is_valid(Cut::new(PLANKMAX)) {
println!("Invalid cut at {PLANKMAX}!!! Handle this");
}
}