Compare commits
2 Commits
9f602bb947
...
a1dceb6ff1
Author | SHA1 | Date | |
---|---|---|---|
a1dceb6ff1 | |||
3712b32634 |
@ -99,8 +99,7 @@ pub struct Map {
|
|||||||
impl<T: BufRead> From<T> for Map {
|
impl<T: BufRead> From<T> for Map {
|
||||||
fn from(input: T) -> Self {
|
fn from(input: T) -> Self {
|
||||||
let grid = Grid::from(input);
|
let grid = Grid::from(input);
|
||||||
let mut visited_from: Grid<DirectionSet> = Grid::new(grid.width() as i64);
|
let visited_from = grid.same_shape(DirectionSet::empty());
|
||||||
visited_from.data.resize(grid.data.len(), DirectionSet::empty());
|
|
||||||
let guard_pos = grid.find(&b'^').expect("Guard not found");
|
let guard_pos = grid.find(&b'^').expect("Guard not found");
|
||||||
let guard_facing = FacingDirection::Up;
|
let guard_facing = FacingDirection::Up;
|
||||||
Self {
|
Self {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user