1
0

Add solver constants

This commit is contained in:
Stefan Müller
2025-12-09 10:54:02 +01:00
parent b981b0b5fe
commit 77743a16dd
4 changed files with 18 additions and 4 deletions
+5 -1
View File
@@ -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;