feat: solve day 1 part 1
This commit is contained in:
+24
-1
@@ -1,5 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/StevanFreeborn/advent-of-code-2025/cmd/01/dial"
|
||||
"github.com/StevanFreeborn/advent-of-code-2025/cmd/01/instruction"
|
||||
"github.com/StevanFreeborn/advent-of-code-2025/internal/file"
|
||||
)
|
||||
|
||||
func SolvePartOne(filePath string) int {
|
||||
return 0
|
||||
lines := file.ReadLines(filePath)
|
||||
dial := dial.New()
|
||||
total := 0
|
||||
|
||||
for _, line := range lines {
|
||||
if line == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
instruction := instruction.FromLine(line)
|
||||
dial.Turn(instruction)
|
||||
|
||||
if dial.Value() == 0 {
|
||||
total++
|
||||
}
|
||||
}
|
||||
|
||||
return total
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user