Compare commits
No commits in common. "d394c3211c1ea41c74ddf6fe603282fb6849fdb3" and "53816fed73dcc0e787e93c7292fe1b918110c376" have entirely different histories.
d394c3211c
...
53816fed73
1 changed files with 6 additions and 7 deletions
|
@ -6,7 +6,7 @@ use std::{
|
|||
use winnow::{
|
||||
PResult, Parser,
|
||||
ascii::{newline, till_line_ending},
|
||||
combinator::{alt, opt, repeat, separated},
|
||||
combinator::{alt, repeat, separated},
|
||||
};
|
||||
|
||||
fn main() {
|
||||
|
@ -36,9 +36,8 @@ fn pt2(input: &str) -> usize {
|
|||
}
|
||||
}
|
||||
|
||||
let board = Board::new(input);
|
||||
for loc in trace {
|
||||
let mut board = board.clone();
|
||||
board = Board::new(input);
|
||||
let mut steps = HashSet::new();
|
||||
board.set(loc, Cell::Obstacle);
|
||||
steps.insert(board.guard);
|
||||
|
@ -231,10 +230,10 @@ fn parse(input: &str) -> PResult<Board> {
|
|||
let mut gdir = Dir::N;
|
||||
let mut loc = Loc(0, 0);
|
||||
|
||||
let (cells, _): (Vec<Vec<Cell>>, _) =
|
||||
winnow::combinator::seq!(separated(1.., parse_line, newline), opt(newline))
|
||||
.parse(input)
|
||||
.unwrap();
|
||||
let mut input = input;
|
||||
let cells: Vec<Vec<Cell>> = separated(1.., parse_line, newline)
|
||||
.parse_next(&mut input)
|
||||
.unwrap();
|
||||
|
||||
for (row, line) in cells.iter().enumerate() {
|
||||
for (col, cell) in line.iter().enumerate() {
|
||||
|
|
Loading…
Reference in a new issue