From f45028d04d5e13f283bb15850e60a2fecfc9ed72 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 19 Dec 2024 17:45:05 +0000 Subject: [PATCH] more debug --- day/02/demo_2_input.txt | 1 + day/02/part2.sh | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/day/02/demo_2_input.txt b/day/02/demo_2_input.txt index baeffbb..118a3b8 100644 --- a/day/02/demo_2_input.txt +++ b/day/02/demo_2_input.txt @@ -7,3 +7,4 @@ 9 8 2 7 9 8 7 1 9 4 10 11 +9 4 10 11 10 diff --git a/day/02/part2.sh b/day/02/part2.sh index edf037a..4786e7b 100755 --- a/day/02/part2.sh +++ b/day/02/part2.sh @@ -93,7 +93,11 @@ while read -r l; do if [[ "${idx}" -eq 1 ]]; then # we may have to re-calculate is_up_down! is_up_down="$((line_split[2] - line_split[0]))" + echo "allowing flip up/down" fi + echo "-------------------" + echo "allowing 1 failure!" + echo "-------------------" else # we skip the re-assign once to 'skip' a number prev_val=$v @@ -105,7 +109,7 @@ while read -r l; do else echo "final check safe" fi - + echo "" safe_count=$((safe_count + is_safe)) done <"$FILE_IN"