diff --git a/day_02/src/main.rs b/day_02/src/main.rs index f381459..3686beb 100644 --- a/day_02/src/main.rs +++ b/day_02/src/main.rs @@ -39,11 +39,14 @@ struct LevelTransition { state: TransitionState, direction: TransitionDirection, } -/// Given two level inputs, return one of the following: -/// - `LevelTransitionState::Bad` if the difference between +/// Given two level inputs, return a LevelTransition of the state: +/// - `TransitionState::Bad` if the difference between /// the levels is either 0 or great than 3 -/// - `LevelTransitionState::Asc` if the value from curr_level to next_level is increasing and it's not BAD -/// - `LevelTransitionState::Desc` if the value from curr_level to next_level is decreasing and it's not BAD +/// - otherwise `TransitionState::Good` +/// +/// And direction: +/// - `TransitionDirection::Asc` if the value from curr_level to next_level is increasing +/// - `TransitionDirection::Desc` if the value from curr_level to next_level is decreasing fn compare_levels(curr_level: i64, next_level: i64) -> LevelTransition { let level_diff = next_level - curr_level;