aoc2024/day-20/cmd/cli/main.go
2024-12-20 20:48:13 +00:00

42 lines
879 B
Go

/********************************************************************************
Advent of Code 2024 - day-20
********************************************************************************/
package main
import (
"embed"
"flag"
"fmt"
"slices"
log "github.com/sirupsen/logrus"
problems "github.com/onyx-and-iris/aoc2024/day-20"
)
//go:embed testdata
var files embed.FS
func main() {
filename := flag.String("f", "input.txt", "input file")
loglevel := flag.Int("l", int(log.InfoLevel), "log level")
flag.Parse()
if slices.Contains(log.AllLevels, log.Level(*loglevel)) {
log.SetLevel(log.Level(*loglevel))
}
data, err := files.ReadFile(fmt.Sprintf("testdata/%s", *filename))
if err != nil {
log.Fatal(err)
}
one, two, err := problems.Solve(data)
if err != nil {
log.Fatal(err)
}
fmt.Printf("solution one: %d\nsolution two: %d\n", one, two)
}