need to fix a nasty bug...

This commit is contained in:
Martin HART 2020-10-31 18:50:29 +01:00
parent 1ced716662
commit afd8b1dc8b
1 changed files with 13 additions and 0 deletions

View File

@ -218,6 +218,19 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut hash: HashMap<robot::Position, u32> = HashMap::new(); let mut hash: HashMap<robot::Position, u32> = HashMap::new();
create_hash_map(&robot_pool, &mut hash); create_hash_map(&robot_pool, &mut hash);
let mut piouff: u32 = 0;
while piouff != robot_pool.len() as u32 {
for r in robot_pool {
if robot::is_piouff(&r) {
piouff += 1;
} else {
r.execute_instruction();
}
check_map(&r, &world)?;
check_collisions(&r, &hash)?;
}
}
Ok(()) Ok(())
} }