Add solver constants
This commit is contained in:
@@ -4,6 +4,10 @@ use std::io::BufRead;
|
||||
|
||||
pub struct PrintingDepartment {}
|
||||
|
||||
impl PrintingDepartment {
|
||||
const PAPER_ROLL_CHAR: char = '@';
|
||||
}
|
||||
|
||||
impl Solver for PrintingDepartment {
|
||||
const PUZZLE_INDEX: u8 = 4;
|
||||
const PUZZLE_NAME: &'static str = "Printing Department";
|
||||
@@ -11,7 +15,7 @@ impl Solver for PrintingDepartment {
|
||||
fn process_data<R: BufRead>(&self, reader: R) -> (u64, u64) {
|
||||
let mut grid = Grid::new(0, 0);
|
||||
for line in reader.lines().map_while(Result::ok) {
|
||||
grid.push_row(line.bytes().map(|c| c == b'@').collect());
|
||||
grid.push_row(line.bytes().map(|c| c == Self::PAPER_ROLL_CHAR as u8).collect());
|
||||
}
|
||||
|
||||
let mut part1 = 0;
|
||||
|
||||
Reference in New Issue
Block a user