From 645bf066b803f6a5b62aba177f792269b92e5377 Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Tue, 3 Dec 2024 03:53:49 -0500 Subject: prep --- 2024/tcl/02.tcl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to '2024/tcl/02.tcl') diff --git a/2024/tcl/02.tcl b/2024/tcl/02.tcl index dac290e..8cc14f3 100755 --- a/2024/tcl/02.tcl +++ b/2024/tcl/02.tcl @@ -22,7 +22,7 @@ proc row_errs {row} { return $row_errs } -while {[gets $input report] != -1} { +foreach report $input { if ![row_errs $report] { incr safe_count; continue } # naive, but handles a case like [1 4 2 3] where removing 2 makes it # safe but an iterative approach only trips on [2]. backtracking @@ -37,8 +37,6 @@ while {[gets $input report] != -1} { incr dampened_safe_count $safe_count -close $input - puts "Safe sequence count: $safe_count" puts "" -- cgit v1.2.3-70-g09d2