diff --git a/src/main.rs b/src/main.rs index e9e1c5e..3733ac9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -218,6 +218,19 @@ fn main() -> Result<(), Box> { let mut hash: HashMap = HashMap::new(); 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(()) }