aoc21/main.go

33 lines
689 B
Go
Raw Normal View History

2022-02-07 21:59:19 +02:00
package main
import (
"fmt"
2022-02-08 20:32:54 +02:00
"log"
2022-02-07 21:59:19 +02:00
"os"
"strings"
"github.com/fotonmoton/aoc2021/client"
"github.com/fotonmoton/aoc2021/d1"
2022-02-07 22:00:52 +02:00
"github.com/fotonmoton/aoc2021/d2"
2022-02-08 21:38:18 +02:00
"github.com/fotonmoton/aoc2021/d3"
2022-02-07 21:59:19 +02:00
)
func main() {
2022-02-08 20:32:54 +02:00
session, err := os.ReadFile("session")
2022-02-07 21:59:19 +02:00
2022-02-08 20:32:54 +02:00
if err != nil {
log.Fatal(err)
}
client := client.NewClient(strings.TrimSpace(string(session)))
fmt.Printf("day 1: %v\n", d1.D1(client.Day(1)))
fmt.Printf("day 1 part 2: %v\n", d1.D1P2(client.Day(1)))
fmt.Printf("day 2: %v\n", d2.D2(client.Day(2)))
2022-02-08 21:38:18 +02:00
fmt.Printf("day 2 part 2: %v\n", d2.D2P2(client.Day(2)))
fmt.Printf("day 3: %v\n", d3.D3(client.Day(3)))
2022-02-09 21:03:38 +02:00
fmt.Printf("day 3 part 2: %v\n", d3.D3P2(client.Day(3)))
2022-02-08 21:38:18 +02:00
2022-02-07 21:59:19 +02:00
}