This commit is contained in:
2024-12-04 09:03:27 +00:00
committed by Gareth
parent e2ab6dce9a
commit b1a4969f6d
5 changed files with 253 additions and 3 deletions

View File

@@ -10,6 +10,8 @@ import (
"adventofcode2024/day01"
"adventofcode2024/day02"
"adventofcode2024/day03"
"adventofcode2024/day04"
)
// Usage: go run main.go <NN>
// assumes input is in day<NN>/input.txt
@@ -27,6 +29,9 @@ func main() {
case 3:
fmt.Printf("part 1: %d\n", day03.Part1(utils.Readfile(d)))
fmt.Printf("part 2: %d\n", day03.Part2(utils.Readfile(d)))
case 4:
fmt.Printf("part 1: %d\n", day04.Part1(utils.Readfile(d)))
fmt.Printf("part 2: %d\n", day04.Part2(utils.Readfile(d)))
default:
panic(fmt.Errorf("no such day: %d", d))
}
@@ -34,7 +39,7 @@ func main() {
// Reads day from os.Args.
func day() int {
latest := 2
latest := 3
if len(os.Args) == 1 {
return latest
}