From 105989cdb71f79a5616880664092095e7a727b7a Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Mon, 12 Dec 2022 21:04:57 +0100 Subject: [PATCH] Remove debugging --- day12-tim/Cargo.toml | 4 +++- day12/src/height_map.rs | 8 -------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/day12-tim/Cargo.toml b/day12-tim/Cargo.toml index 0672eff..2e547db 100644 --- a/day12-tim/Cargo.toml +++ b/day12-tim/Cargo.toml @@ -3,6 +3,8 @@ name = "day12-tim" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[package.metadata.nix] +build = true +app = true [dependencies] diff --git a/day12/src/height_map.rs b/day12/src/height_map.rs index 107b179..ffd1365 100644 --- a/day12/src/height_map.rs +++ b/day12/src/height_map.rs @@ -12,7 +12,6 @@ pub struct HeightMap { impl HeightMap { pub fn find_shortest_path_len_to_end(&self) -> usize { - let mut iterations = 0; let mut visited: Vec = self.heights.iter().map(|_| false).collect(); let mut open: PriorityQueue, DefaultHashBuilder> = PriorityQueue::with_hasher(DefaultHashBuilder::default()); @@ -25,14 +24,7 @@ impl HeightMap { .0; open.push(end_idx, Reverse(0)); while let Some((current_idx, Reverse(current_score))) = open.pop() { - iterations += 1; if self.heights[current_idx] == TARGET { - eprintln!( - "Iter: {iterations} | {}x{} = {}", - self.width, - self.height, - self.height * self.width - ); return current_score as usize; } visited[current_idx] = true;