feat: wip on day 10 part 2

This commit is contained in:
Stevan Freeborn
2025-12-24 18:13:07 -06:00
parent a2024af1b4
commit 838eb99ed9
4 changed files with 349 additions and 28 deletions
+7
View File
@@ -1,6 +1,8 @@
package main
import (
"fmt"
"github.com/StevanFreeborn/advent-of-code-2025/cmd/10/machine"
"github.com/StevanFreeborn/advent-of-code-2025/internal/file"
)
@@ -20,9 +22,14 @@ func SolvePartOne(filePath string) int {
func SolvePartTwo(filePath string) int {
total := 0
linesRead := 0
for line := range file.ReadLines(filePath) {
linesRead++
machine := machine.From(line)
buttonsPressed := machine.ConfigureJoltages()
if buttonsPressed == 0 {
fmt.Printf("No solution found for line %d: %s\n", linesRead, line)
}
total += buttonsPressed
}