From 58a5c05cfc04ef10c0efed3fa72f05bf00ccc19e Mon Sep 17 00:00:00 2001 From: Joey Pollack Date: Tue, 10 Dec 2024 16:32:53 -0500 Subject: [PATCH] Adds some minor comments --- crates/day_7/src/day_7.rs | 2 ++ crates/day_7/src/equation.rs | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/day_7/src/day_7.rs b/crates/day_7/src/day_7.rs index 88ab82a..ab47321 100644 --- a/crates/day_7/src/day_7.rs +++ b/crates/day_7/src/day_7.rs @@ -45,6 +45,8 @@ impl Day7 fn solve_first_case(self: &mut Self) -> String { + // The engineers just need the total calibration result, + // which is the sum of the test values from just the equations that could possibly be true. self.final_result.to_string() } diff --git a/crates/day_7/src/equation.rs b/crates/day_7/src/equation.rs index 8886b49..3d70c6f 100644 --- a/crates/day_7/src/equation.rs +++ b/crates/day_7/src/equation.rs @@ -58,4 +58,13 @@ impl Equation println!(); } + + // Returns None if the equation can not be made true + // NOTE: Operators are always evaluated left-to-right, not according to precedence rules! + pub fn can_be_true(self: &Equation) -> Option> + { + + + None + } } \ No newline at end of file