]> fbox.kageds.com Git - adventofcode.git/blobdiff - 2023/go/main.go
day02
[adventofcode.git] / 2023 / go / main.go
index ab4582a9a55099620acb5ace1ec78c2db19cb72e..1ef3bec1831f41848dec504d39aa98d7ee11ac26 100644 (file)
@@ -8,6 +8,7 @@ import (
 //     "time"
        "adventofcode2023/utils"
        "adventofcode2023/day01"
 //     "time"
        "adventofcode2023/utils"
        "adventofcode2023/day01"
+       "adventofcode2023/day02"
 )
 // 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
@@ -19,6 +20,9 @@ func main() {
        case 1:
                fmt.Printf("part 1: %d\n", day01.Part1(utils.Readfile(d)))
                fmt.Printf("part 2: %d\n", day01.Part2(utils.Readfile(d)))
        case 1:
                fmt.Printf("part 1: %d\n", day01.Part1(utils.Readfile(d)))
                fmt.Printf("part 2: %d\n", day01.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)))
        default:
                panic(fmt.Errorf("no such day: %d", d))
        }
        default:
                panic(fmt.Errorf("no such day: %d", d))
        }
@@ -26,7 +30,7 @@ func main() {
 
 // Reads day from os.Args.
 func day() int {
 
 // Reads day from os.Args.
 func day() int {
-       latest := 0
+       latest := 1
        if len(os.Args) == 1 {
                return latest
        }
        if len(os.Args) == 1 {
                return latest
        }