fix failing tests
This commit is contained in:
14 files changed
+51
-149
No files matched your search
+1
-3
@@ -25,9 +25,7 @@ fn part2(input: &Grid<u8>) -> u64 {
|
||||
let mut removed_iteration = 0;
|
||||
for i in 0..grid.width() * grid.height() {
|
||||
let pos = grid.coord(i as i64).unwrap();
|
||||
if grid.get(&pos).is_some_and(|c| *c == b'@')
|
||||
&& grid.adjacent_count(&pos, |c| *c == b'@') < 4
|
||||
{
|
||||
if grid.get(&pos).is_some_and(|c| *c == b'@') && grid.adjacent_count(&pos, |c| *c == b'@') < 4 {
|
||||
// remove the roll
|
||||
grid.set(&pos, b'.');
|
||||
removed_iteration += 1;
|
||||
|
||||
Reference in new issue
Block a user