From 4c8a42d80a9b22e591f18c287e54f5d1cbdb98b2 Mon Sep 17 00:00:00 2001 From: Clement Desmidt Date: Fri, 17 Dec 2021 10:53:00 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Nettoie=20un=20peu=20le=20?= =?UTF-8?q?jour=2017?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day_17/part_1.php | 6 ------ day_17/part_2.php | 6 ------ 2 files changed, 12 deletions(-) diff --git a/day_17/part_1.php b/day_17/part_1.php index 2afc2b9..d081e98 100644 --- a/day_17/part_1.php +++ b/day_17/part_1.php @@ -9,7 +9,6 @@ $target = ['x_min' => $x_min, 'x_max' => $x_max, 'y_min' => $y_min, 'y_max' => $ function increment(&$x, &$y, &$x_velocity, &$y_velocity) { - $current_x = $x; $x += $x_velocity; $y += $y_velocity; if ($x_velocity > 0) $x_velocity -= 1; @@ -26,11 +25,6 @@ function check($x, $y, $target) $y <= $target['y_max']; } -$x = 0; -$y = 0; -$x_velocity = 6; -$y_velocity = 9; - $max = 0; for ($i = 1; $i < abs($target['x_min']); $i++) { $tmp_max = 0; diff --git a/day_17/part_2.php b/day_17/part_2.php index 8c7b5f4..756d06f 100644 --- a/day_17/part_2.php +++ b/day_17/part_2.php @@ -9,7 +9,6 @@ $target = ['x_min' => $x_min, 'x_max' => $x_max, 'y_min' => $y_min, 'y_max' => $ function increment(&$x, &$y, &$x_velocity, &$y_velocity) { - $current_x = $x; $x += $x_velocity; $y += $y_velocity; if ($x_velocity > 0) $x_velocity -= 1; @@ -26,11 +25,6 @@ function check($x, $y, $target) $y <= $target['y_max']; } -$x = 0; -$y = 0; -$x_velocity = 6; -$y_velocity = 9; - $possibilities = []; for ($i = 0; $i <= abs($target['x_max']); $i++) { for ($j = -abs($target['y_min']); $j <= abs($target['y_min']); $j++) {