1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
cb41e4db56 disable day 14 part 2 because it requires manual intervention 2024-12-14 13:30:19 +01:00
f273c1719c clippy 2024-12-14 13:29:03 +01:00

View File

@@ -10,8 +10,8 @@ use itertools::Itertools;
pub fn day_main() { pub fn day_main() {
let input = read_to_string("input/day14.txt").unwrap(); let input = read_to_string("input/day14.txt").unwrap();
let input = input.trim(); let input = input.trim();
println!(" part1: {}", part1(input)); // 50112000 too low println!(" part1: {}", part1(input));
println!(" part2: {}", part2(input)); // println!(" part2: {}", part2(input));
} }
type RiddleResult = usize; type RiddleResult = usize;
@@ -45,7 +45,6 @@ fn solve_part1(input: &str, rounds: i64, width: i64, height: i64) -> RiddleResul
.filter(|&&((px, py), _)| px > width / 2 && py > height / 2) .filter(|&&((px, py), _)| px > width / 2 && py > height / 2)
.count(); .count();
if upper_left + lower_left == upper_right + lower_right {}
upper_left * lower_left * upper_right * lower_right upper_left * lower_left * upper_right * lower_right
} }
@@ -68,6 +67,7 @@ fn parse(input: &str) -> Vec<((i64, i64), (i64, i64))> {
.collect_vec() .collect_vec()
} }
#[allow(unused)]
fn part2(input: &str) -> RiddleResult { fn part2(input: &str) -> RiddleResult {
let width = 101; let width = 101;
let height = 103; let height = 103;
@@ -105,7 +105,9 @@ fn part2(input: &str) -> RiddleResult {
unreachable!() unreachable!()
} }
fn printr(robots: &[((i64, i64), (i64, i64))], width: i64, height: i64) { type Robot = ((i64, i64), (i64, i64));
fn printr(robots: &[Robot], width: i64, height: i64) {
for y in 0..height { for y in 0..height {
for x in 0..width { for x in 0..width {
let c = robots let c = robots