From 87f1c05d723677b091b0b56338ef457f20d5f4f9 Mon Sep 17 00:00:00 2001 From: MelKam Date: Sat, 24 Dec 2022 18:30:03 +0000 Subject: [PATCH] 2022_12: golang solution(part 1) --- .vscode/launch.json | 10 ++- 2022/day_12/golang/go.mod | 3 + 2022/day_12/golang/graph/bfs.go | 41 +++++++++++++ 2022/day_12/golang/graph/coords.go | 28 +++++++++ 2022/day_12/golang/graph/graph.go | 69 +++++++++++++++++++++ 2022/day_12/golang/graph/vertex.go | 51 ++++++++++++++++ 2022/day_12/golang/main.go | 98 ++++++++++++++++++++++++++++++ 2022/day_12/input.txt | 41 +++++++++++++ 2022/day_12/map.txt | 41 +++++++++++++ go.work | 5 ++ 10 files changed, 384 insertions(+), 3 deletions(-) create mode 100644 2022/day_12/golang/go.mod create mode 100644 2022/day_12/golang/graph/bfs.go create mode 100644 2022/day_12/golang/graph/coords.go create mode 100644 2022/day_12/golang/graph/graph.go create mode 100644 2022/day_12/golang/graph/vertex.go create mode 100644 2022/day_12/golang/main.go create mode 100644 2022/day_12/input.txt create mode 100644 2022/day_12/map.txt create mode 100644 go.work diff --git a/.vscode/launch.json b/.vscode/launch.json index 631e428..3e3c4ef 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,9 +1,13 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "Day 12 golang", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/2022/day_12/golang/main.go" + }, { "type": "lldb", "request": "launch", diff --git a/2022/day_12/golang/go.mod b/2022/day_12/golang/go.mod new file mode 100644 index 0000000..46f44b1 --- /dev/null +++ b/2022/day_12/golang/go.mod @@ -0,0 +1,3 @@ +module github.com/MellKam/advent_of_code/2022/day_12/golang + +go 1.19 diff --git a/2022/day_12/golang/graph/bfs.go b/2022/day_12/golang/graph/bfs.go new file mode 100644 index 0000000..ea040e0 --- /dev/null +++ b/2022/day_12/golang/graph/bfs.go @@ -0,0 +1,41 @@ +package graph + +type BFSNode struct { + vertex *Vertex + distance int +} + +func GetShortestPath(startVertex *Vertex, endCoords Coords) int { + visited := make(map[Coords]bool) + queue := make([]BFSNode, 0) + + queue = append(queue, BFSNode{vertex: startVertex, distance: 0}) + visited[startVertex.Key()] = true + + for len(queue) > 0 { + node := queue[0] + queue = queue[1:] + + key := node.vertex.Key() + if endCoords.Equal(&key) { + return node.distance + } + + nextNeighbour := node.vertex.Iter() + for { + neighbour := nextNeighbour() + if neighbour == nil { + break + } + + key = neighbour.Key() + + if !visited[key] { + queue = append(queue, BFSNode{vertex: neighbour, distance: node.distance + 1}) + visited[key] = true + } + } + } + + return -1 +} diff --git a/2022/day_12/golang/graph/coords.go b/2022/day_12/golang/graph/coords.go new file mode 100644 index 0000000..92d3359 --- /dev/null +++ b/2022/day_12/golang/graph/coords.go @@ -0,0 +1,28 @@ +package graph + +import "fmt" + +type Coords struct { + x uint + y uint +} + +func (c *Coords) Equal(c2 *Coords) bool { + return c.x == c2.x && c.y == c2.y +} + +func (c *Coords) String() string { + return fmt.Sprintf("x: %d, y: %d", c.x, c.y) +} + +func NewCoords(x uint, y uint) Coords { + return Coords{x: x, y: y} +} + +func (c *Coords) X() uint { + return c.x +} + +func (c *Coords) Y() uint { + return c.y +} diff --git a/2022/day_12/golang/graph/graph.go b/2022/day_12/golang/graph/graph.go new file mode 100644 index 0000000..c355820 --- /dev/null +++ b/2022/day_12/golang/graph/graph.go @@ -0,0 +1,69 @@ +package graph + +import "fmt" + +type Graph struct { + veritces []*Vertex + Height uint + Width uint +} + +func (g *Graph) AddVertex(vertex Vertex) error { + if g.ContainsKey(&vertex.key) { + return fmt.Errorf("vertex with key {%v} already exists", vertex.key.String()) + } + + g.veritces = append(g.veritces, &vertex) + return nil +} + +func (g *Graph) GetVertex(coords Coords) *Vertex { + for _, v := range g.veritces { + if v.key.Equal(&coords) { + return v + } + } + + return nil +} + +func (g *Graph) ContainsKey(coords *Coords) bool { + for _, v := range g.veritces { + if v.key.Equal(coords) { + return true + } + } + + return false +} + +func (g *Graph) String() string { + s := "Graph {\n" + for i, vertex := range g.veritces { + if i > 0 { + s += ",\n" + } + s += fmt.Sprintf(" %v", vertex.String()) + + } + return s + "\n}" +} + +func (g *Graph) Iter() func() *Vertex { + var index = 0 + var length = len(g.veritces) + + return func() *Vertex { + if index >= length { + return nil + } + + v := g.veritces[index] + index++ + return v + } +} + +func (g *Graph) Len() int { + return len(g.veritces) +} diff --git a/2022/day_12/golang/graph/vertex.go b/2022/day_12/golang/graph/vertex.go new file mode 100644 index 0000000..bfeb406 --- /dev/null +++ b/2022/day_12/golang/graph/vertex.go @@ -0,0 +1,51 @@ +package graph + +import "fmt" + +type Vertex struct { + key Coords + value byte + adjacents []*Vertex +} + +func NewVertex(key Coords, value byte) Vertex { + return Vertex{key: key, value: value} +} + +func (v *Vertex) AddEdge(v2 *Vertex) { + v.adjacents = append(v.adjacents, v2) +} + +func (v *Vertex) Key() Coords { + return v.key +} + +func (v *Vertex) Value() byte { + return v.value +} + +func (v *Vertex) String() string { + s := fmt.Sprintf("Vertex[%v] {", v.key.String()) + for i, vertex := range v.adjacents { + if i > 0 { + s += ", " + } + s += fmt.Sprintf("{%v}", vertex.key.String()) + } + return s + "}" +} + +func (v *Vertex) Iter() func() *Vertex { + var index = 0 + var length = len(v.adjacents) + + return func() *Vertex { + if index >= length { + return nil + } + + v := v.adjacents[index] + index++ + return v + } +} diff --git a/2022/day_12/golang/main.go b/2022/day_12/golang/main.go new file mode 100644 index 0000000..20db31a --- /dev/null +++ b/2022/day_12/golang/main.go @@ -0,0 +1,98 @@ +package main + +import ( + "fmt" + "os" + "strings" + + "github.com/MellKam/advent_of_code/2022/day_12/golang/graph" +) + +func main() { + data, err := os.ReadFile("./2022/day_12/input.txt") + if err != nil { + panic(err) + } + + g, startCoords, endCoords := FillGraph(string(data)) + + startVertex := g.GetVertex(startCoords) + if startVertex == nil { + panic("startVertex is nil") + } + + shortestPath := graph.GetShortestPath(startVertex, endCoords) + + fmt.Println(shortestPath) +} + +func FillGraph(data string) (graph.Graph, graph.Coords, graph.Coords) { + var startCoords graph.Coords + var endCoords graph.Coords + + lines := strings.Split(data, "\n") + height := len(lines) + width := len(lines[0]) + + g := graph.Graph{Width: uint(width), Height: uint(height)} + + for y, line := range lines { + for x, char := range line { + var vertex graph.Vertex + coords := graph.NewCoords(uint(x), uint(y)) + var value byte + + if char == 'S' { + // "S" => start point (elevation 'a') + value = byte('a') + startCoords = coords + } else if char == 'E' { + // "E" => end point (elevation 'z') + value = byte('z') + endCoords = coords + } else { + value = byte(char) + } + + vertex = graph.NewVertex(coords, value-96) + err := g.AddVertex(vertex) + if err != nil { + panic(err) + } + } + } + + nextVertex := g.Iter() + + for { + vertex := nextVertex() + + if vertex == nil { + break + } + + coords := vertex.Key() + + left := g.GetVertex(graph.NewCoords(coords.X()-1, coords.Y())) + right := g.GetVertex(graph.NewCoords(coords.X()+1, coords.Y())) + top := g.GetVertex(graph.NewCoords(coords.X(), coords.Y()-1)) + bottom := g.GetVertex(graph.NewCoords(coords.X(), coords.Y()+1)) + + ConnectVertexesByTarget(vertex, left) + ConnectVertexesByTarget(vertex, right) + ConnectVertexesByTarget(vertex, top) + ConnectVertexesByTarget(vertex, bottom) + } + + return g, startCoords, endCoords +} + +func ConnectVertexesByTarget(v1 *graph.Vertex, v2 *graph.Vertex) { + if v2 == nil { + return + } + + if int(v2.Value())-int(v1.Value()) <= 1 { + v1.AddEdge(v2) + } +} diff --git a/2022/day_12/input.txt b/2022/day_12/input.txt new file mode 100644 index 0000000..148db32 --- /dev/null +++ b/2022/day_12/input.txt @@ -0,0 +1,41 @@ +abcccccccccccccccccaaaaaaaaccccccacccaaccccccccccccccccccaaaaaaaaaacccccccccccccccccccccccccccccccaaaaaaccccccccccccccccccccccccccccccccccaaaaa +abccccccccccccccccccaaaaacccccccaaaaaaacccccccccccaaccaaaaaaaaaaaaaccccccccccccccccccccccccccccccccaaaaacccccccccccccccccccccccccccccccccaaaaaa +abccccccccccccaaccccaaaaaacccccccaaaaaaaaccccccacaaaccaaaaaaaaaaaaaaaccccccccccccccccccaaacccccccaaaaaaaccccccccccccccccaaaccccccccccccccaaaaaa +abccccccccacccaaccccaaaaaacccccccaaaaaaaaaccccaaaaaaaaacaaaaaaaaaaaaacccccccccccccccccccaacccccccaaaaaaaacccccccccccccccaaaccccccccccccccaccaaa +abaacccccaaaaaaaccccaaaccacccccccaaaaaaaaaccccaaaaaaaaccccaaaaaaaaaaaccccccccccccccccaacaaaaaccccaaaaaaaacccccccccccccccaaacccccccccccccccccaaa +abaaccccccaaaaaaaacccccccccccccccaaaaaaaaccccccaaaaaacccccaaaacaaaaccccccccccccccccccaaaaaaaaccccccaaacaccccccccccccccccaaakccaaaccccccccccccaa +abaaacccccaaaaaaaaaccccccccccccccaaaaaaacccccccaaaaaccccccaaaccaaaaccccccccccccaacacccaaaaaccccccccaaacccccccccccccacacckkkkkkkaacccccccccccccc +abaaacccccaaaaaaaaaccccccccccccccaccaaaaaccccccaaaaaacccccaaacaaaccccccccccccccaaaaccccaaaaacccccccccccccccccccccccaaaakkkkkkkkkacccaaaccaccccc +abacacccccaaaaaaaccccccccccccccccccccaaaaaaaccccccaaccccccaaaaaaaaccccccccccccaaaaacccaaacaacccccccccccccccccccccccaajkkkkppkkkkccccaaaaaaccccc +abacccccccaaaaaaacccccccccccccccccccaaaaaaaaccccccccccccccccaaaaaaccccccccccccaaaaaacccaacccccccccccccccccccccccccccjjkkooppppkllccccaaaaaccccc +abccccccccaccaaaccccccccccccccccccccaaaaaaaacccccccccccccccccaaaaaccccccccccccacaaaacccccccccccccccccccccccccccccjjjjjjoooppppklllcacaaaaaccccc +abcccaacccccccaaacccccccccccccccccccaaaaaaacccccccccccccccccaaaaacccccccccccccccaacaccccccccccccccccccccccccccjjjjjjjjoooopuppplllcccccaaaacccc +abcccaacccccccccccccccccaaacccccccccccaaaaaaccccccaaaaacccccaaaaaccccccccccccaaacaaacccccaaaccccccccccccccccijjjjjjjjooouuuuuppllllcccccaaacccc +abaaaaaaaaccccccccccccccaaaaccccccccccaacaaaccccccaaaaaccccccccccccccccccccccaaaaaaacccccaaacacccccccccccccciijjoooooooouuuuuppplllllccccaccccc +abaaaaaaaaccccccccccccccaaaaccccccccccaacccccccccaaaaaacccccccccccccccccccccccaaaaaacccaaaaaaaacccccccccccciiiqqooooooouuuxuuuppplllllccccccccc +abccaaaaccccccccccccccccaaaccccccccccccccccccccccaaaaaacccccccccccccccccccccccaaaaaaaccaaaaaaaacccccccccccciiiqqqqtttuuuuxxxuupppqqllllmccccccc +abcaaaaacccaaaccccccccccccccccccccccccaccccccccccaaaaaacccccccccccccccccccccaaaaaaaaaaccaaaaaaccccccccccccciiiqqqtttttuuuxxxuuvpqqqqmmmmccccccc +abcaacaaaccaaacaaccccccccccccccccccccaaaacaaaccccccaacccaaaaacccccccccccccccaaaaaaaaaacccaaaaacccaaaccccccciiiqqttttxxxxxxxyuvvvvqqqqmmmmcccccc +abcacccaaccaaaaaaccccccccccccccccccccaaaaaaaacccccccccccaaaaacccccccccccccccaaacaaacccccaaaaaaccaaaacccccaaiiiqqtttxxxxxxxxyyvvvvvvqqqmmmdddccc +abcccccccaaaaaaaccccccccccccccccccccccaaaaaaaaacccccccccaaaaaaccccccccccccccccccaaaccccccaacccccaaaacccaaaaiiiqqqttxxxxxxxyyyyyyvvvqqqmmmdddccc +SbccccccccaaaaaccccccccaacaaccccccccaaaaaaaaaaccccccccccaaaaaaccccccccccccaaacccaaccccccccccccccaaaacccaaaaaiiiqqtttxxxxEzzyyyyvvvvqqqmmmdddccc +abaccccccccaaaaacccccccaaaaacccccccaaaaaaaaaaaccccccccccaaaaaaccccccccccaaaaaacccccccccccccccccccccccccaaaaaiiiqqqtttxxxyyyyyyvvvvqqqmmmdddcccc +abaacccccccaacaaaccccccaaaaaacccccccaaaaaaaaaaccccccccccccaaacccccccccccaaaaaaccccccccccccccccccccccccccaaaahhhqqqqttxxyyyyyyvvvvqqqmmmddddcccc +abaccccccccaaccccccccccaaaaaacccaacaaccaaaaaaaaaccccccccccccccccccccccccaaaaaaccccccccccccccccccccccccccaaaachhhqqtttxwyyyyyywvrqqqmmmmdddccccc +abaaaccccccccccccccccccaaaaaacccaaaaaccaaaaacaaaccccccccccccccccccccccccaaaaaccccaaaaccccaaaccccccccccccccccchhhppttwwwywwyyywwrrrnmmmdddcccccc +abaaaccccccccccccccccccccaaaccccaaaaaacaaaaaaaaaccccccccaaacccccccccccccaaaaaccccaaaaccccaaaccccccccccccccccchhpppsswwwwwwwwywwrrrnnndddccccccc +abaaacccccccccccccccccccccccccccaaaaaacccaaaaaacccccccccaaaaacccccaacccccccccccccaaaacaaaaaaaaccccccccccccccchhpppsswwwwsswwwwwrrrnneeddccccccc +abaccccccccaaaacccccccccccccccccaaaaaaccccaaaaaaaacccccaaaaaaccaacaaacccccccccccccaaccaaaaaaaaccccccccccccccchhpppssssssssrwwwwrrrnneeecaaccccc +abaccccccccaaaacccccccccccccccccccaaaccccaaaaaaaaacccccaaaaaaccaaaaaccccccccccccccccccccaaaaacccccccccccccccchhpppssssssssrrrwrrrnnneeeaaaccccc +abcccccccccaaaacccccccccccccccccccccccccaaaaaaaaaaccccccaaaaacccaaaaaacccccccccccccccccaaaaaacccccccccccccccchhpppppsssooorrrrrrrnnneeeaaaccccc +abcccccccccaaaccccccccccccccccccccccccccaaacaaacccccccccaacaacaaaaaaaacccccccccccccccccaaaaaacaaccccccccccccchhhppppppoooooorrrrnnneeeaaaaacccc +abccccccccccccccccccccccccccccccccccccccccccaaaccaaaacccccccccaaaaacaaccccaacccccccccacaaaaaacaaccccccccccccchhhgpppppoooooooonnnnneeeaaaaacccc +abcccccccaacccccccccccccccccccccccccccccccccaaacaaaaaccccccccccacaaaccccccaacccccccccaacaaaaaaaaaaacccccaaccccgggggggggggfooooonnneeeeaaaaacccc +abcccccccaaacaaccccccccccccaacccccccccccccccccccaaaaaaccccaacccccaaacccaaaaaaaaccccccaaaaacaaaaaaaaccccaaacccccggggggggggfffooonneeeecaaacccccc +abcccccccaaaaaaccccaacccccaaacccccccccccccccccccaaaaaaccccaaaccccccccccaaaaaaaacccccccaaaaaccaaaaccccaaaaaaaacccggggggggfffffffffeeeecaaccccccc +abcccccaaaaaaaccaaaaacaaaaaaacccccccccccccccccccaaaaacccccaaaacccaaccccccaaaacccccccaaaaaaaacaaaaacccaaaaaaaaccccccccccaaaffffffffecccccccccccc +abcaaacaaaaaaacccaaaaaaaaaaaaaaaccccccccccccccccccaaacccccaaaacaaaacaacccaaaaaccccccaaaaaaaaaaaaaaccccaaaaaacccccccccccaaacaafffffccccccccccaaa +abaaaacccaaaaaaccaaaaacaaaaaaaaaccccccccccccaaacccccccccccaaaaaaaaacaaccaaacaacccccccccaacccaaccaaccccaaaaaaccccccccccaaaaccaaacccccccccccccaaa +abaaaacccaacaaacaaaaacccaaaaaaacccccccccccccaaaacccccccccaaaaaaaaaaaaaccaacccacccccccccaacccccccccccccaaaaaaccccccccccaaacccccccccccccccccccaaa +abcaaacccaacccccccaaaccaaaaaacccccccccccccccaaaaccccccaaaaaaaaaaaaaaaaaaccccccccccccccccccccccccccccccaaccaaccccccccccaaaccccccccccccccccaaaaaa +abcccccccccccccccccccccaaaaaaaccccccccccccccaaacccccccaaaaaaaaaaaaaaaaaacccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccaaaaaa \ No newline at end of file diff --git a/2022/day_12/map.txt b/2022/day_12/map.txt new file mode 100644 index 0000000..b985a8a --- /dev/null +++ b/2022/day_12/map.txt @@ -0,0 +1,41 @@ +...................aaaaaaaa......acccaa..................aaaaaaaaaa...............................aaaaaa..................................aaaaa +....................aaaaa.......aaaaaaa...........aa..aaaaaaaaaaaaa................................aaaaa.................................aaaaaa +..............aa....aaaaaa.......aaaaaaaa......a.aaa..aaaaaaaaaaaaaaa..................aaa.......aaaaaaa................aaa..............aaaaaa +..........a...aa....aaaaaa.......aaaaaaaaa....aaaaaaaaa.aaaaaaaaaaaaa...................aa.......aaaaaaaa...............aaa..............a..aaa +.........aaaaaaa....aaa..a.......aaaaaaaaa....aaaaaaaa....aaaaaaaaaaa................aa.aaaaa....aaaaaaaa...............aaa.................aaa +..........aaaaaaaa...............aaaaaaaa......aaaaaa.....aaaacaaaa..................aaaaaaaa......aaa.a................aaa...aaa............aa +..........aaaaaaaaa..............aaaaaaa.......aaaaa......aaaccaaaa............aa.a...aaaaa........aaa.............a.a.........aa.............. +..........aaaaaaaaa..............a..aaaaa......aaaaaa.....aaacaaa..............aaaa....aaaaa.......................aaaa.........a...aaa..a..... +..........aaaaaaa....................aaaaaaa......aa......aaaaaaaa............aaaaa...aaa.aa.......................aa.....pp........aaaaaa..... +..........aaaaaaa...................aaaaaaaa................aaaaaa............aaaaaa...aa...............................oopppp.......aaaaa..... +..........a..aaa....................aaaaaaaa.................aaaaa............a.aaaa...................................ooopppp.....a.aaaaa..... +..............aaa...................aaaaaaa.................aaaaa...............aaca..................................oooopuppp........aaaa.... +........................aaa...........aaaaaa......aaaaa.....aaaaa............aaacaaa.....aaa.........................ooouuuuupp.........aaa.... +........................aaaa..........aa.aaa......aaaaa......................aaaaaaa.....aaa.a..................oooooooouuuuuppp.........a..... +........................aaaa..........aa.........aaaaaa.......................aaaaaa...aaaaaaaa.................ooooooouuuxuuuppp.............. +........................aaa......................aaaaaa.......................aaaaaaa..aaaaaaaa...................tttuuuuxxxuupppqq............ +...........aaa........................a..........aaaaaa.....................aaaaaaaaaa..aaaaaa...................tttttuuuxxxuuvpqqqq........... +...........aaa.aa....................aaaa.aaa......aa...aaaaa...............aaaaaaaaaa...aaaaa...aaa............ttttxxxxxxxyuvvvvqqqq.......... +...........aaaaaa....................aaaaaaaa...........aaaaa...............aaa.aaa.....aaaaaa..aaaa.....aa.....tttxxxxxxxxyyvvvvvvqqq......... +.........aaaaaaa......................aaaaaaaaa.........aaaaaa..................aaa......aa.....aaaa...aaaa......ttxxxxxxxyyyyyyvvvqqq......... +..........aaaaa........aa.aa........aaaaaaaaaa..........aaaaaa............aaa...aa..............aaaa...aaaaa.....tttxxxxzzzyyyyvvvvqqq......... +...........aaaaa.......aaaaa.......aaaaaaaaaaa..........aaaaaa..........aaaaaa.........................aaaaa......tttxxxyyyyyyvvvvqqq.......... +...........aa.aaa......aaaaaa.......aaaaaaaaaa............aaa...........aaaaaa..........................aaaa.......ttxxyyyyyyvvvvqqq........... +...........aa..........aaaaaa...aa.aa..aaaaaaaaa........................aaaaaa..........................aaaa......tttxwyyyyyywvrqqq............ +.......................aaaaaa...aaaaa..aaaaacaaa........................aaaaa....aaaa....aaa......................ttwwwywwyyywwrrr............. +.........................aaa....aaaaaa.aaaaaaaaa........aaa.............aaaaa....aaaa....aaa......................sswwwwwwwwywwrrr............. +................................aaaaaa...aaaaaa.........aaaaa.....aa.............aaaa.aaaaaaaa....................sswwwwsswwwwwrrr............. +...........aaaa.................aaaaaa....aaaaaaaa.....aaaaaa..aa.aaa.............aa..aaaaaaaa....................ssssssssrwwwwrrr......aa..... +...........aaaa...................aaa....aaaaaaaaa.....aaaaaa..aaaaa....................aaaaa.....................ssssssssrrrwrrr......aaa..... +...........aaaa.........................aaaaaaaaaa......aaaaa...aaaaaa.................aaaaaa.......................sss...rrrrrrr......aaa..... +...........aaa..........................aaa.aaa.........aa.aa.aaaaaaaa.................aaaaaa.aa............................rrrr......aaaaa.... +............................................aaa..aaaa.........aaaaacaa....aa.........a.aaaaaa.aa......................................aaaaa.... +.........aa.................................aaa.aaaaa..........a.aaa......aa.........aacaaaaaaaaaaa.....aa............................aaaaa.... +.........aaa.aa............aa...................aaaaaa....aa.....aaa...aaaaaaaa......aaaaacaaaaaaaa....aaa............................aaa...... +.........aaaaaa....aa.....aaa...................aaaaaa....aaa..........aaaaaaaa.......aaaaaccaaaa....aaaaaaaa.........................aa....... +.......aaaaaaa..aaaaa.aaaaaaa...................aaaaa.....aaaa...aa......aaaa.......aaaaaaaacaaaaa...aaaaaaaa..........aaa..................... +.......aaaaaaa...aaaaaaaaaaaaaaa..................aaa.....aaaa.aaaa.aa...aaaaa......aaaaaaaaaaaaaa....aaaaaa...........aaa.aa...............aaa +.........aaaaaa..aaaaa.aaaaaaaaa............aaa...........aaaaaaaaa.aa..aaa.aa.........aa...aa..aa....aaaaaa..........aaaa..aaa.............aaa +.........aa.aaa.aaaaa...aaaaaaa.............aaaa.........aaaaaaaaaaaaa..aa...a.........aa.............aaaaaa..........aaa...................aaa +.........aa.......aaa..aaaaaa...............aaaa......aaaaaaaaaaaaaaaaaa..............................aa..aa..........aaa................aaaaaa +.......................aaaaaaa..............aaa.......aaaaaaaaaaaaaaaaaa.................................................................aaaaaa \ No newline at end of file diff --git a/go.work b/go.work new file mode 100644 index 0000000..4e5104b --- /dev/null +++ b/go.work @@ -0,0 +1,5 @@ +go 1.19 + +use ( + ./2022/day_12/golang +)