day17: don't revisit the start position
This commit is contained in:
parent
3ee26cefe5
commit
e65c17c8e6
@ -311,6 +311,7 @@ impl<'a> WalkCost2<'a> {
|
|||||||
weight: cur_move.weight + self.map.map[new_pos.1][new_pos.0],
|
weight: cur_move.weight + self.map.map[new_pos.1][new_pos.0],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
.filter(|m| m.new_pos != self.start)
|
||||||
.filter(|m| *m.dir != cur_move.dir.opposite())
|
.filter(|m| *m.dir != cur_move.dir.opposite())
|
||||||
.filter(|m| {
|
.filter(|m| {
|
||||||
if m.dir == cur_move.dir {
|
if m.dir == cur_move.dir {
|
||||||
|
Loading…
Reference in New Issue
Block a user