From 2bc1b97c2d4ebc62943c2ca661a634aacc6b98e3 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 17 Dec 2021 18:39:49 +0100 Subject: [PATCH] 2021: day17: better bounds for part 1 --- aoc2021/src/day17.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aoc2021/src/day17.rs b/aoc2021/src/day17.rs index 9e6ab15..8a0181a 100644 --- a/aoc2021/src/day17.rs +++ b/aoc2021/src/day17.rs @@ -42,8 +42,8 @@ fn part1(input: &str) -> Result { let (min_x_vel, max_x_vel) = (min_x_vel.min(max_x_vel), min_x_vel.max(max_x_vel)); // we could launch the prob downward, but in that case max Y reached would always be 0 - let min_y_vel = 0; - let max_y_vel = 5000; // idk + let min_y_vel = 1; + let max_y_vel = area.min_y().abs(); (min_x_vel..=max_x_vel) .flat_map(|x_vel| (min_y_vel..=max_y_vel).map(move |y_vel| (x_vel, y_vel)))