Add macro arm for only running single part of days solution

This commit is contained in:
Matt Clarke 2023-12-05 13:31:31 +00:00
parent 47e4f227bd
commit fb4ac26f32

View file

@ -45,4 +45,22 @@ macro_rules! solution {
run_part(part_two, &input, DAY, 2); run_part(part_two, &input, DAY, 2);
} }
}; };
($day:expr, 1) => { /// Allows solving part one in isolation
const DAY: advent_of_code::Day = advent_of_code::day!($day);
fn main() {
use advent_of_code::template::runner::*;
let input = advent_of_code::template::read_file("inputs", DAY);
run_part(part_one, &input, DAY, 1);
}
};
($day:expr, 2) => { /// Allows solving part two in isolation
const DAY: advent_of_code::Day = advent_of_code::day!($day);
fn main() {
use advent_of_code::template::runner::*;
let input = advent_of_code::template::read_file("inputs", DAY);
run_part(part_two, &input, DAY, 2);
}
};
} }