mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-08 13:50:48 +00:00
42 lines
879 B
Go
42 lines
879 B
Go
/********************************************************************************
|
|
Advent of Code 2024 - day-08
|
|
********************************************************************************/
|
|
|
|
package main
|
|
|
|
import (
|
|
"embed"
|
|
"flag"
|
|
"fmt"
|
|
"slices"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
problems "github.com/onyx-and-iris/aoc2024/day-08"
|
|
)
|
|
|
|
//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)
|
|
}
|