feat: wip on day 10 part 2
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user