diff --git a/day8/dayEight.go b/day8/dayEight.go index 00195b6..72f694a 100644 --- a/day8/dayEight.go +++ b/day8/dayEight.go @@ -11,7 +11,7 @@ import ( func Run() int { fmt.Print("hello day 8") - filename := "day8/example3" + filename := "day8/input" net, path := Read(filename) fmt.Printf("got %+v and %+v\n", net, path) result := GhostTraverse(net, path) @@ -84,6 +84,7 @@ func GhostTraverse(net Network, path Path) int { } // oh, i don't need to seed the cycle, they are already not equal + cycle := 0 for !allEqual(stepCounts) { max := slices.Max(stepCounts) for i, pathInfo := range pathInfos { @@ -100,7 +101,10 @@ func GhostTraverse(net Network, path Path) int { stepCounts[i] += overJump } } - log.Printf("done one cycle iteration, results : %+v", stepCounts) + cycle += 1 + if cycle % 10000000 == 0 { + log.Printf("done %d cycle iteration, results : %+v", cycle, stepCounts) + } } return stepCounts[0]