36 lines
643 B
Go
36 lines
643 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
|
|
"git.eising.cloud/eising/aoc2024/days/day1"
|
|
)
|
|
|
|
func main() {
|
|
day := flag.Int("day", 1, "Day of the challenge to run (1-24)")
|
|
useExample := flag.Bool("exampledata", false, "Load example data instead of actual challenge data.")
|
|
|
|
flag.Parse()
|
|
|
|
filename := fmt.Sprintf("days/day%d/test_input.txt", *day)
|
|
|
|
if *useExample {
|
|
filename = fmt.Sprintf("days/day%d/example.txt", *day)
|
|
}
|
|
|
|
if *day < 1 || *day > 24 {
|
|
fmt.Println("That's not very Christmas.")
|
|
os.Exit(1)
|
|
}
|
|
|
|
switch *day {
|
|
case 1:
|
|
day1.Day1(filename)
|
|
default:
|
|
fmt.Printf("Solution for day %d is not ready yet.\n", *day)
|
|
}
|
|
|
|
}
|