Re-implement a solution for the first day 1 puzzle, move common code into a library package.
This commit is contained in:
parent
333321cfd7
commit
01f53ae30c
3 changed files with 44 additions and 19 deletions
18
2018/day01-1.go
Normal file
18
2018/day01-1.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"internal/calibration"
|
||||
)
|
||||
|
||||
// Provide a filename as input, get the result on stdout
|
||||
func main() {
|
||||
x := 0
|
||||
seen := calibration.Set{} // we don't use this until day01-2, just added here for backwards compatibility
|
||||
|
||||
x, _ = calibration.ScanFrequencies(os.Args[1], &seen, x)
|
||||
|
||||
fmt.Println("Frequency list scanned, calibration complete: ", x)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue