JPTYS433ESGA2UUNKQT4JMAWFU7KVIU7F5RKDZTUR7RR5A2COBVQC
OK5CKW6E72XAZTRJUWSKFPJBPZYNIWQGVXFR5ARSJHB6EIBMU6WQC
5TH3AA466T4JIICGT3LTLJ554X62KF36XZUXKR5MIAXVWAGQQHWQC
Y4AQJ5RDUWK2F4WBVYTWVU6XCUZGL7JYFK34CT7FBMXBJ24ICSHAC
USO5PZWOGMYH6BUHQO3AQHDQBQ4EO27OSSAVPUWCUIZVFO3PNFJQC
VSG6UWDYMGCJHOVD5BI5UNAAYLVL6REAAJLI7OXUGCSXLJZTV36QC
ZJPL7VNQEYASQ7QIUCR3X2IPWF5MAR6WX7VY6OWMRDMPJK7GYWIAC
CT3VONTOEWK5SOJ64L7II6NUITVM2S73UEC4UXXVAKBB4JEUOXKQC
MLUGR2LLRTENFPCXBML4VQKWNE5QURMC7RJDE3AQYZXAJWOWILDQC
RQRFFUF6EN2RMBL5ITLF4HYJPGNMYXNTV4YNWH2BUCVZQE5KY2AQC
C5VVJ5SOXXMIWNHCY4BLV5JOXDLDSFGP5QI7WWB74XIZ4JJMIBVAC
B75B3UUKURXWL6VBIJK3IKNDBH6MOLECYDOZR5LSQQILVMKFMIAAC
if plank.length() > (ROOMLENGTH - row.get_coverage()) {
// Cut the plank to length
let (plankpart, leftover) = plank.cut_to_length(ROOMLENGTH - row.get_coverage());
match plank.length() {
length if length < (ROOMLENGTH - row.get_coverage()) => {
// Cut the plank to length
let (plankpart, leftover) = plank.cut_to_length(ROOMLENGTH - row.get_coverage());
// Add the remainder of plank to the row (move)
// also increase the row coverage
row.add_coverage(plankpart.length());
row.add(plankpart);
// Add the remaining plank to material storage
ms.store_used(leftover);
} else if plank.length() == ROOMLENGTH - row.get_coverage() {
// If the plank is the same length as the room, no need to cut
// Add the remainder of plank to the row (move)
// also increase the row coverage
row.add_coverage(plankpart.length());
row.add(plankpart);
// Add the remaining plank to material storage
ms.store_used(leftover);
}
length if length == (ROOMLENGTH - row.get_coverage()) => {
// If the plank is the same length as the room, no need to cut
// Take a new plank and continue
plank = ms.try_get_used()?;
row.add_used_planks();
} else {
// Plank is shorter than the room, need multiple
// Take a new plank and continue
plank = ms.try_get_used()?;
row.add_used_planks();
}
_ => {
// Plank is shorter than the room, need multiple