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
+6 -1
View File
@@ -5,6 +5,10 @@ use std::io::BufRead;
pub struct Cafeteria {}
impl Cafeteria {
const INTERVAL_SPLIT_CHAR: char = '-';
}
impl Solver for Cafeteria {
const PUZZLE_INDEX: u8 = 5;
const PUZZLE_NAME: &'static str = "Cafeteria";
@@ -17,7 +21,8 @@ impl Solver for Cafeteria {
.lines()
.map_while(|x| x.ok().filter(|s| !s.is_empty()))
{
let values: Vec<u64> = line.split('-').map_while(|s| s.parse().ok()).collect();
// TODO: This code should move into new common::interval::MultiInterval struct.
let values: Vec<u64> = line.split(Self::INTERVAL_SPLIT_CHAR).map_while(|s| s.parse().ok()).collect();
let mut interval = Interval::new(values[0], values[1]);
let mut to_delete = Vec::new();