This commit is contained in:
2024-12-08 20:48:48 +00:00
parent 616618c7e2
commit 19c4afdc98
11 changed files with 1770 additions and 4 deletions

View File

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