Initial commit
This commit is contained in:
35
main.go
Normal file
35
main.go
Normal file
@ -0,0 +1,35 @@
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user