]> fbox.kageds.com Git - adventofcode.git/blobdiff - 2023/go/main.go
day05
[adventofcode.git] / 2023 / go / main.go
index 1ef3bec1831f41848dec504d39aa98d7ee11ac26..0f19aeb50405e509bf10f950f06d52b0c8711f52 100644 (file)
@@ -9,6 +9,8 @@ import (
        "adventofcode2023/utils"
        "adventofcode2023/day01"
        "adventofcode2023/day02"
        "adventofcode2023/utils"
        "adventofcode2023/day01"
        "adventofcode2023/day02"
+       "adventofcode2023/day03"
+       "adventofcode2023/day04"
 )
 // Usage: go run main.go <NN>
 // assumes input is in day<NN>/input.txt
 )
 // Usage: go run main.go <NN>
 // assumes input is in day<NN>/input.txt
@@ -23,6 +25,12 @@ func main() {
        case 2:
                fmt.Printf("part 1: %d\n", day02.Part1(utils.Readfile(d)))
                fmt.Printf("part 2: %d\n", day02.Part2(utils.Readfile(d)))
        case 2:
                fmt.Printf("part 1: %d\n", day02.Part1(utils.Readfile(d)))
                fmt.Printf("part 2: %d\n", day02.Part2(utils.Readfile(d)))
+       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))
        }
        default:
                panic(fmt.Errorf("no such day: %d", d))
        }
@@ -30,7 +38,7 @@ func main() {
 
 // Reads day from os.Args.
 func day() int {
 
 // Reads day from os.Args.
 func day() int {
-       latest := 1
+       latest := 3
        if len(os.Args) == 1 {
                return latest
        }
        if len(os.Args) == 1 {
                return latest
        }
@@ -83,5 +91,6 @@ func TestPart2(t *testing.T) {
 }
 `, n))
        fmt.Printf("wrote day%02d/day%02d_test.go\n", n, n)
 }
 `, n))
        fmt.Printf("wrote day%02d/day%02d_test.go\n", n, n)
+       utils.GenInputFile(n)
 
 }
\ No newline at end of file
 
 }
\ No newline at end of file