From 4130343ad6d8cab4d28eb463eb93ebb73c75efea Mon Sep 17 00:00:00 2001 From: RPJosh Date: Fri, 1 Dec 2023 13:12:28 +0100 Subject: [PATCH] Preparations for 2023 --- cmd/adventOfCode/main.go | 54 +++---- go.mod | 2 +- internal/{ => 2022}/day_01/in.go | 2 +- internal/{ => 2022}/day_02/in.go | 0 internal/{ => 2022}/day_03/in.go | 0 internal/{ => 2022}/day_04/in.go | 0 internal/{ => 2022}/day_05/in.go | 0 internal/{ => 2022}/day_06/in.go | 0 internal/{ => 2022}/day_07/in.go | 0 internal/{ => 2022}/day_08/in.go | 0 internal/{ => 2022}/day_09/in.go | 0 internal/{ => 2022}/day_10/in.go | 0 internal/2022/day_11/in.go | 154 +++++++++++++++++++ internal/2022/day_12/in.go | 244 +++++++++++++++++++++++++++++++ internal/{ => 2022}/day_13/in.go | 0 internal/{ => 2022}/day_14/in.go | 0 internal/{ => 2022}/day_15/in.go | 0 internal/{ => 2022}/day_16/in.go | 0 internal/{ => 2022}/day_17/in.go | 0 internal/{ => 2022}/day_18/in.go | 0 internal/{ => 2022}/day_19/in.go | 0 internal/{ => 2022}/day_20/in.go | 0 internal/{ => 2022}/day_21/in.go | 0 internal/{ => 2022}/day_22/in.go | 0 internal/{ => 2022}/day_23/in.go | 0 internal/{ => 2022}/day_24/in.go | 0 internal/{ => 2022}/day_25/in.go | 0 internal/2023/day_01/in.go | 11 ++ internal/2023/day_02/in.go | 11 ++ internal/2023/day_03/in.go | 11 ++ internal/2023/day_04/in.go | 11 ++ internal/2023/day_05/in.go | 11 ++ internal/2023/day_06/in.go | 11 ++ internal/2023/day_07/in.go | 11 ++ internal/2023/day_08/in.go | 11 ++ internal/2023/day_09/in.go | 11 ++ internal/2023/day_10/in.go | 11 ++ internal/{ => 2023}/day_11/in.go | 0 internal/{ => 2023}/day_12/in.go | 0 internal/2023/day_13/in.go | 11 ++ internal/2023/day_14/in.go | 11 ++ internal/2023/day_15/in.go | 11 ++ internal/2023/day_16/in.go | 11 ++ internal/2023/day_17/in.go | 11 ++ internal/2023/day_18/in.go | 11 ++ internal/2023/day_19/in.go | 11 ++ internal/2023/day_20/in.go | 11 ++ internal/2023/day_21/in.go | 11 ++ internal/2023/day_22/in.go | 11 ++ internal/2023/day_23/in.go | 11 ++ internal/2023/day_24/in.go | 11 ++ internal/2023/day_25/in.go | 11 ++ pkg/utils/utils.go | 2 +- run.sh | 2 +- 54 files changed, 682 insertions(+), 31 deletions(-) rename internal/{ => 2022}/day_01/in.go (95%) rename internal/{ => 2022}/day_02/in.go (100%) rename internal/{ => 2022}/day_03/in.go (100%) rename internal/{ => 2022}/day_04/in.go (100%) rename internal/{ => 2022}/day_05/in.go (100%) rename internal/{ => 2022}/day_06/in.go (100%) rename internal/{ => 2022}/day_07/in.go (100%) rename internal/{ => 2022}/day_08/in.go (100%) rename internal/{ => 2022}/day_09/in.go (100%) rename internal/{ => 2022}/day_10/in.go (100%) create mode 100644 internal/2022/day_11/in.go create mode 100644 internal/2022/day_12/in.go rename internal/{ => 2022}/day_13/in.go (100%) rename internal/{ => 2022}/day_14/in.go (100%) rename internal/{ => 2022}/day_15/in.go (100%) rename internal/{ => 2022}/day_16/in.go (100%) rename internal/{ => 2022}/day_17/in.go (100%) rename internal/{ => 2022}/day_18/in.go (100%) rename internal/{ => 2022}/day_19/in.go (100%) rename internal/{ => 2022}/day_20/in.go (100%) rename internal/{ => 2022}/day_21/in.go (100%) rename internal/{ => 2022}/day_22/in.go (100%) rename internal/{ => 2022}/day_23/in.go (100%) rename internal/{ => 2022}/day_24/in.go (100%) rename internal/{ => 2022}/day_25/in.go (100%) create mode 100644 internal/2023/day_01/in.go create mode 100644 internal/2023/day_02/in.go create mode 100644 internal/2023/day_03/in.go create mode 100644 internal/2023/day_04/in.go create mode 100644 internal/2023/day_05/in.go create mode 100644 internal/2023/day_06/in.go create mode 100644 internal/2023/day_07/in.go create mode 100644 internal/2023/day_08/in.go create mode 100644 internal/2023/day_09/in.go create mode 100644 internal/2023/day_10/in.go rename internal/{ => 2023}/day_11/in.go (100%) rename internal/{ => 2023}/day_12/in.go (100%) create mode 100644 internal/2023/day_13/in.go create mode 100644 internal/2023/day_14/in.go create mode 100644 internal/2023/day_15/in.go create mode 100644 internal/2023/day_16/in.go create mode 100644 internal/2023/day_17/in.go create mode 100644 internal/2023/day_18/in.go create mode 100644 internal/2023/day_19/in.go create mode 100644 internal/2023/day_20/in.go create mode 100644 internal/2023/day_21/in.go create mode 100644 internal/2023/day_22/in.go create mode 100644 internal/2023/day_23/in.go create mode 100644 internal/2023/day_24/in.go create mode 100644 internal/2023/day_25/in.go diff --git a/cmd/adventOfCode/main.go b/cmd/adventOfCode/main.go index b01760b..dc24210 100644 --- a/cmd/adventOfCode/main.go +++ b/cmd/adventOfCode/main.go @@ -5,36 +5,36 @@ import ( "os" "strconv" - "rpjosh.de/adventOfCode2022/internal/day_01" - "rpjosh.de/adventOfCode2022/internal/day_02" - "rpjosh.de/adventOfCode2022/internal/day_03" - "rpjosh.de/adventOfCode2022/internal/day_04" - "rpjosh.de/adventOfCode2022/internal/day_05" - "rpjosh.de/adventOfCode2022/internal/day_06" - "rpjosh.de/adventOfCode2022/internal/day_07" - "rpjosh.de/adventOfCode2022/internal/day_08" - "rpjosh.de/adventOfCode2022/internal/day_09" - "rpjosh.de/adventOfCode2022/internal/day_10" - "rpjosh.de/adventOfCode2022/internal/day_11" - "rpjosh.de/adventOfCode2022/internal/day_12" - "rpjosh.de/adventOfCode2022/internal/day_13" - "rpjosh.de/adventOfCode2022/internal/day_14" - "rpjosh.de/adventOfCode2022/internal/day_15" - "rpjosh.de/adventOfCode2022/internal/day_16" - "rpjosh.de/adventOfCode2022/internal/day_17" - "rpjosh.de/adventOfCode2022/internal/day_18" - "rpjosh.de/adventOfCode2022/internal/day_19" - "rpjosh.de/adventOfCode2022/internal/day_20" - "rpjosh.de/adventOfCode2022/internal/day_21" - "rpjosh.de/adventOfCode2022/internal/day_22" - "rpjosh.de/adventOfCode2022/internal/day_23" - "rpjosh.de/adventOfCode2022/internal/day_24" - "rpjosh.de/adventOfCode2022/internal/day_25" - "rpjosh.de/adventOfCode2022/pkg/utils" + "rpjosh.de/adventOfCode/internal/2023/day_01" + "rpjosh.de/adventOfCode/internal/2023/day_02" + "rpjosh.de/adventOfCode/internal/2023/day_03" + "rpjosh.de/adventOfCode/internal/2023/day_04" + "rpjosh.de/adventOfCode/internal/2023/day_05" + "rpjosh.de/adventOfCode/internal/2023/day_06" + "rpjosh.de/adventOfCode/internal/2023/day_07" + "rpjosh.de/adventOfCode/internal/2023/day_08" + "rpjosh.de/adventOfCode/internal/2023/day_09" + "rpjosh.de/adventOfCode/internal/2023/day_10" + "rpjosh.de/adventOfCode/internal/2023/day_11" + "rpjosh.de/adventOfCode/internal/2023/day_12" + "rpjosh.de/adventOfCode/internal/2023/day_13" + "rpjosh.de/adventOfCode/internal/2023/day_14" + "rpjosh.de/adventOfCode/internal/2023/day_15" + "rpjosh.de/adventOfCode/internal/2023/day_16" + "rpjosh.de/adventOfCode/internal/2023/day_17" + "rpjosh.de/adventOfCode/internal/2023/day_18" + "rpjosh.de/adventOfCode/internal/2023/day_19" + "rpjosh.de/adventOfCode/internal/2023/day_20" + "rpjosh.de/adventOfCode/internal/2023/day_21" + "rpjosh.de/adventOfCode/internal/2023/day_22" + "rpjosh.de/adventOfCode/internal/2023/day_23" + "rpjosh.de/adventOfCode/internal/2023/day_24" + "rpjosh.de/adventOfCode/internal/2023/day_25" + "rpjosh.de/adventOfCode/pkg/utils" ) func main() { - year := 2022 + year := 2023 day := 1 if len(os.Args) >= 2 && os.Args[1] != "" { var err error diff --git a/go.mod b/go.mod index 88a611c..c4d48d1 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module rpjosh.de/adventOfCode2022 +module rpjosh.de/adventOfCode go 1.18 diff --git a/internal/day_01/in.go b/internal/2022/day_01/in.go similarity index 95% rename from internal/day_01/in.go rename to internal/2022/day_01/in.go index 71425ba..46f2768 100644 --- a/internal/day_01/in.go +++ b/internal/2022/day_01/in.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "rpjosh.de/adventOfCode2022/pkg/utils" + "rpjosh.de/adventOfCode/pkg/utils" ) type Day struct{} diff --git a/internal/day_02/in.go b/internal/2022/day_02/in.go similarity index 100% rename from internal/day_02/in.go rename to internal/2022/day_02/in.go diff --git a/internal/day_03/in.go b/internal/2022/day_03/in.go similarity index 100% rename from internal/day_03/in.go rename to internal/2022/day_03/in.go diff --git a/internal/day_04/in.go b/internal/2022/day_04/in.go similarity index 100% rename from internal/day_04/in.go rename to internal/2022/day_04/in.go diff --git a/internal/day_05/in.go b/internal/2022/day_05/in.go similarity index 100% rename from internal/day_05/in.go rename to internal/2022/day_05/in.go diff --git a/internal/day_06/in.go b/internal/2022/day_06/in.go similarity index 100% rename from internal/day_06/in.go rename to internal/2022/day_06/in.go diff --git a/internal/day_07/in.go b/internal/2022/day_07/in.go similarity index 100% rename from internal/day_07/in.go rename to internal/2022/day_07/in.go diff --git a/internal/day_08/in.go b/internal/2022/day_08/in.go similarity index 100% rename from internal/day_08/in.go rename to internal/2022/day_08/in.go diff --git a/internal/day_09/in.go b/internal/2022/day_09/in.go similarity index 100% rename from internal/day_09/in.go rename to internal/2022/day_09/in.go diff --git a/internal/day_10/in.go b/internal/2022/day_10/in.go similarity index 100% rename from internal/day_10/in.go rename to internal/2022/day_10/in.go diff --git a/internal/2022/day_11/in.go b/internal/2022/day_11/in.go new file mode 100644 index 0000000..f452650 --- /dev/null +++ b/internal/2022/day_11/in.go @@ -0,0 +1,154 @@ +package day_11 + +import ( + "fmt" + "strings" + + "rpjosh.de/adventOfCode/pkg/utils" +) + +type Day struct{} + +type MonkeyData struct { + operation MonkeyOperation + test MonkeyTest + items []int + inspectedItems int +} + +type MonkeyOperation struct { + multiply bool + sameValue bool + value int +} + +type MonkeyTest struct { + divValue int + trueThrowTo int + falseThrowTo int +} + +func (d *Day) Part1(in string) string { + return d.Perform(in, false, 20) +} + +func (d *Day) Part2(in string) string { + return d.Perform(in, true, 10000) +} + +func (d *Day) Perform(in string, part2 bool, iterations int) string { + var monkeys []MonkeyData + + part2DivValues := 1 + for i, val := range strings.Split(in, "\n") { + mongo := i / 7 + + // Parse monkey data + switch i % 7 { + case 0: + { + monkeys = append(monkeys, MonkeyData{}) + } + case 1: + { + // Starting items + items := strings.Split(val[18:], ", ") + //monkeys[mongo].items = make([]int, 10) + for _, item := range items { + monkeys[mongo].items = append(monkeys[mongo].items, utils.ToInt(item)) + } + } + case 2: + { + // Operation >19 maxOne { + maxTwo = maxOne + maxOne = monkey.inspectedItems + } else if monkey.inspectedItems > maxTwo { + maxTwo = monkey.inspectedItems + } + } + + return fmt.Sprintf("%d", maxOne*maxTwo) +} diff --git a/internal/2022/day_12/in.go b/internal/2022/day_12/in.go new file mode 100644 index 0000000..d916ee7 --- /dev/null +++ b/internal/2022/day_12/in.go @@ -0,0 +1,244 @@ +package day_12 + +import ( + "fmt" + "strings" + "time" +) + +type Day struct { + heightMap [][]rune + visited [][]bool + + currentPosition Position + destinationPosition Position +} + +type Position struct { + row int + column int +} + +const MaxInt = int(^uint(0) >> 1) + +func (d *Day) Part1(in string) string { + + // Parse map + for i, val := range strings.Split(in, "\n") { + d.heightMap = append(d.heightMap, make([]rune, len(val))) + d.visited = append(d.visited, make([]bool, len(val)+2)) + + for c := 0; c < len(val); c++ { + d.heightMap[i][c] = rune(val[c]) + d.visited[i][c] = false + + strVal := val[c : c+1] + if strVal == "S" { + d.currentPosition = Position{i, c} + + min := "a" + d.heightMap[i][c] = rune(min[0]) + + d.visited[i][c] = true + } else if strVal == "E" { + d.destinationPosition = Position{i, c} + + min := "z" + d.heightMap[i][c] = rune(min[0]) + } + } + } + d.visited = append(d.visited, make([]bool, 220)) + + //fmt.Printf("\n%s\n", d.heightMap[0]) + i, _ := d.makeOneStep(d.visited, d.currentPosition, 0) + return fmt.Sprintf("%d", i) +} + +// Brute force the shortest way :) +// Positions already visited are ignored +func (d *Day) makeOneStep(visited [][]bool, pos Position, stepsMade int) (int, [][]bool) { + currentVal := d.heightMap[pos.row][pos.column] + visited[pos.row][pos.column] = true + + // We are arrived + if pos.column == d.destinationPosition.column && pos.row == d.destinationPosition.row { + fmt.Printf("We are here: %d\n", stepsMade) + time.Sleep(50 * time.Millisecond) + return stepsMade, visited + } + minSteps := MaxInt + var minVisited [][]bool = clone(&visited) + if stepsMade == 0 { + //fmt.Printf("\nPossible to right: %t", isStepPossible(d.heightMap[pos.row][pos.column], d.heightMap[pos.row][pos.column+1])) + //fmt.Printf("%d %d\n", d.heightMap[pos.row][pos.column], d.heightMap[pos.row][pos.column+1]) + //fmt.Printf("Posistion: %s\n", pos) + //fmt.Printf("%s", visited2[1]) + } + + //visitedReal := clone(&visited) + //if pos.row >= 18 && pos.row <= 24 && pos.column <= 184 && pos.column >= 12 { + fmt.Printf("Position: %s (%d)\n", pos, stepsMade) + //fmt.Printf("End: %s\n", d.destinationPosition) + //fmt.Printf("Visited: %s", visited[pos.row]) + //time.Sleep(50 * time.Millisecond) + //} + //fmt.Printf("Visided: %s\n", visited) + + // Make a step to each direction an return the last one + // Because we could get trapped + if d.isNotVisitedAndPossible(pos.column+1, pos.row, visited, currentVal) { + //fmt.Printf("Going to the right :) \n") + steps, vis := d.makeOneStep(visited, Position{column: pos.column + 1, row: pos.row}, stepsMade+1) + + if steps <= minSteps { + minVisited = vis + minSteps = steps + //visited = clone(&visitedReal) + //visited[pos.row][pos.column+1] = true + + //minVisited = vis + //minVisited = realVisited + } // else { + visited[pos.row][pos.column+1] = true + minVisited[pos.row][pos.column+1] = true + //visited = clone(&visitedReal) + //visited = vis + //visited[pos.row][pos.column] = false + + //visited[pos.row][pos.column+1] = true + //visited = realVisited + //} + } + if d.isNotVisitedAndPossible(pos.column-1, pos.row, visited, currentVal) { + //fmt.Printf("Going to the left :) \n") + steps, vis := d.makeOneStep(visited, Position{column: pos.column - 1, row: pos.row}, stepsMade+1) + + if steps <= minSteps { + minVisited = vis + minSteps = steps + // Remove visited flag of previous + //visited[pos.row][pos.column-1] = true + + //visited[pos.row][pos.column+1] = false + + //visited = clone(&visitedReal) + + //visited = vis + //minVisited = vis + //minVisited = realVisited + } // else { + visited[pos.row][pos.column-1] = true + minVisited[pos.row][pos.column-1] = true + //visited = clone(&visitedReal) + //visited = vis + //visited[pos.row][pos.column] = false + //visited[pos.row][pos.column-1] = false + //visited = realVisited + //} + } + if d.isNotVisitedAndPossible(pos.column, pos.row+1, visited, currentVal) { + //fmt.Printf("Going to the top :) \n") + steps, vis := d.makeOneStep(visited, Position{column: pos.column, row: pos.row + 1}, stepsMade+1) + + if steps <= minSteps { + minVisited = vis + minSteps = steps + + //visited = clone(&visitedReal) + //visited[pos.row+1][pos.column] = true + + //visited[pos.row][pos.column+1] = false + //if pos.column != 0 { + // visited[pos.row+1][pos.column] = false + //} + + //minVisited = vis + //minVisited = realVisited + } // else { + visited[pos.row+1][pos.column] = true + minVisited[pos.row+1][pos.column] = true + //visited = clone(&visitedReal) + //visited[pos.row][pos.column] = false + //visited = vis + //visited = realVisited + //} + } + if d.isNotVisitedAndPossible(pos.column, pos.row-1, visited, currentVal) { + //fmt.Printf("Going to the bottom :) \n") + steps, vis := d.makeOneStep(visited, Position{column: pos.column, row: pos.row - 1}, stepsMade+1) + + if steps <= minSteps { + minVisited = vis + minSteps = steps + + //vis[pos.row-1][pos.column] = false + + //visited[pos.row][pos.column+1] = false + + //visited[pos.row+1][pos.column] = false + + //visited = clone(&visitedReal) + + //visited = vis + //minVisited = vis + + //minVisited = realVisited + } // else { + visited[pos.row-1][pos.column] = true + minVisited[pos.row-1][pos.column] = true + //visited = clone(&visitedReal) + //visited[pos.row][pos.column] = false + //visited = vis + //} + } + + //fmt.Printf("Steps made: %d\n", minSteps) + // No step was was possible + if minSteps == MaxInt { + return minSteps, visited + } + + //minVisited[pos.row-1][pos.column] = true + //minVisited[pos.row+1][pos.column] = true + //minVisited[pos.row][pos.column+1] = true + //minVisited[pos.row][pos.column-1] = true + return minSteps, minVisited +} + +func (d *Day) isNotVisitedAndPossible(column int, row int, visited [][]bool, currentPos rune) bool { + return d.isNotVisited(row, column, visited) && isStepPossible(currentPos, d.heightMap[row][column]) +} + +func (d *Day) isNotVisited(row int, column int, visited [][]bool) bool { + if row < 0 || column < 0 || row >= len(d.heightMap) || column >= len(d.heightMap[row]) { + // We are on standing on the edge + return false + } + + // Check if all four directions are already visited + return !visited[row][column] || + (row+1 != len(visited) && !visited[row+1][column] && isStepPossible(d.heightMap[row][column], d.heightMap[row+1][column])) || + (column+1 != len(visited[row]) && !visited[row][column+1] && isStepPossible(d.heightMap[row][column], d.heightMap[row][column+1])) || + (row != 0 && !visited[row-1][column] && isStepPossible(d.heightMap[row][column], d.heightMap[row-1][column])) || + (column != 0 && !visited[row][column-1] && isStepPossible(d.heightMap[row][column], d.heightMap[row][column-1])) +} + +// Can we master the height +func isStepPossible(current rune, next rune) bool { + return next-1 <= current +} + +func (d *Day) Part2(in string) string { + return "" +} + +func clone(visited *[][]bool) [][]bool { + var s = make([][]bool, len(*visited)) + for i := range s { + s[i] = make([]bool, len((*visited)[i])) + copy(s[i], (*visited)[i]) + } + //copy(s, *visited) + return s +} diff --git a/internal/day_13/in.go b/internal/2022/day_13/in.go similarity index 100% rename from internal/day_13/in.go rename to internal/2022/day_13/in.go diff --git a/internal/day_14/in.go b/internal/2022/day_14/in.go similarity index 100% rename from internal/day_14/in.go rename to internal/2022/day_14/in.go diff --git a/internal/day_15/in.go b/internal/2022/day_15/in.go similarity index 100% rename from internal/day_15/in.go rename to internal/2022/day_15/in.go diff --git a/internal/day_16/in.go b/internal/2022/day_16/in.go similarity index 100% rename from internal/day_16/in.go rename to internal/2022/day_16/in.go diff --git a/internal/day_17/in.go b/internal/2022/day_17/in.go similarity index 100% rename from internal/day_17/in.go rename to internal/2022/day_17/in.go diff --git a/internal/day_18/in.go b/internal/2022/day_18/in.go similarity index 100% rename from internal/day_18/in.go rename to internal/2022/day_18/in.go diff --git a/internal/day_19/in.go b/internal/2022/day_19/in.go similarity index 100% rename from internal/day_19/in.go rename to internal/2022/day_19/in.go diff --git a/internal/day_20/in.go b/internal/2022/day_20/in.go similarity index 100% rename from internal/day_20/in.go rename to internal/2022/day_20/in.go diff --git a/internal/day_21/in.go b/internal/2022/day_21/in.go similarity index 100% rename from internal/day_21/in.go rename to internal/2022/day_21/in.go diff --git a/internal/day_22/in.go b/internal/2022/day_22/in.go similarity index 100% rename from internal/day_22/in.go rename to internal/2022/day_22/in.go diff --git a/internal/day_23/in.go b/internal/2022/day_23/in.go similarity index 100% rename from internal/day_23/in.go rename to internal/2022/day_23/in.go diff --git a/internal/day_24/in.go b/internal/2022/day_24/in.go similarity index 100% rename from internal/day_24/in.go rename to internal/2022/day_24/in.go diff --git a/internal/day_25/in.go b/internal/2022/day_25/in.go similarity index 100% rename from internal/day_25/in.go rename to internal/2022/day_25/in.go diff --git a/internal/2023/day_01/in.go b/internal/2023/day_01/in.go new file mode 100644 index 0000000..190cf49 --- /dev/null +++ b/internal/2023/day_01/in.go @@ -0,0 +1,11 @@ +package day_01 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_02/in.go b/internal/2023/day_02/in.go new file mode 100644 index 0000000..bc6c878 --- /dev/null +++ b/internal/2023/day_02/in.go @@ -0,0 +1,11 @@ +package day_02 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_03/in.go b/internal/2023/day_03/in.go new file mode 100644 index 0000000..d1da985 --- /dev/null +++ b/internal/2023/day_03/in.go @@ -0,0 +1,11 @@ +package day_03 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_04/in.go b/internal/2023/day_04/in.go new file mode 100644 index 0000000..5216173 --- /dev/null +++ b/internal/2023/day_04/in.go @@ -0,0 +1,11 @@ +package day_04 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_05/in.go b/internal/2023/day_05/in.go new file mode 100644 index 0000000..7f45e3c --- /dev/null +++ b/internal/2023/day_05/in.go @@ -0,0 +1,11 @@ +package day_05 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_06/in.go b/internal/2023/day_06/in.go new file mode 100644 index 0000000..13c4fba --- /dev/null +++ b/internal/2023/day_06/in.go @@ -0,0 +1,11 @@ +package day_06 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_07/in.go b/internal/2023/day_07/in.go new file mode 100644 index 0000000..2e8ba94 --- /dev/null +++ b/internal/2023/day_07/in.go @@ -0,0 +1,11 @@ +package day_07 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_08/in.go b/internal/2023/day_08/in.go new file mode 100644 index 0000000..ba756a5 --- /dev/null +++ b/internal/2023/day_08/in.go @@ -0,0 +1,11 @@ +package day_08 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_09/in.go b/internal/2023/day_09/in.go new file mode 100644 index 0000000..4b931f3 --- /dev/null +++ b/internal/2023/day_09/in.go @@ -0,0 +1,11 @@ +package day_09 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_10/in.go b/internal/2023/day_10/in.go new file mode 100644 index 0000000..d92902b --- /dev/null +++ b/internal/2023/day_10/in.go @@ -0,0 +1,11 @@ +package day_10 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/day_11/in.go b/internal/2023/day_11/in.go similarity index 100% rename from internal/day_11/in.go rename to internal/2023/day_11/in.go diff --git a/internal/day_12/in.go b/internal/2023/day_12/in.go similarity index 100% rename from internal/day_12/in.go rename to internal/2023/day_12/in.go diff --git a/internal/2023/day_13/in.go b/internal/2023/day_13/in.go new file mode 100644 index 0000000..6aa3e94 --- /dev/null +++ b/internal/2023/day_13/in.go @@ -0,0 +1,11 @@ +package day_13 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_14/in.go b/internal/2023/day_14/in.go new file mode 100644 index 0000000..1b56511 --- /dev/null +++ b/internal/2023/day_14/in.go @@ -0,0 +1,11 @@ +package day_14 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_15/in.go b/internal/2023/day_15/in.go new file mode 100644 index 0000000..de6f3a3 --- /dev/null +++ b/internal/2023/day_15/in.go @@ -0,0 +1,11 @@ +package day_15 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_16/in.go b/internal/2023/day_16/in.go new file mode 100644 index 0000000..b4d376e --- /dev/null +++ b/internal/2023/day_16/in.go @@ -0,0 +1,11 @@ +package day_16 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_17/in.go b/internal/2023/day_17/in.go new file mode 100644 index 0000000..edc5354 --- /dev/null +++ b/internal/2023/day_17/in.go @@ -0,0 +1,11 @@ +package day_17 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_18/in.go b/internal/2023/day_18/in.go new file mode 100644 index 0000000..223a2c5 --- /dev/null +++ b/internal/2023/day_18/in.go @@ -0,0 +1,11 @@ +package day_18 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_19/in.go b/internal/2023/day_19/in.go new file mode 100644 index 0000000..6e3005c --- /dev/null +++ b/internal/2023/day_19/in.go @@ -0,0 +1,11 @@ +package day_19 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_20/in.go b/internal/2023/day_20/in.go new file mode 100644 index 0000000..e53c4e0 --- /dev/null +++ b/internal/2023/day_20/in.go @@ -0,0 +1,11 @@ +package day_20 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_21/in.go b/internal/2023/day_21/in.go new file mode 100644 index 0000000..d0df887 --- /dev/null +++ b/internal/2023/day_21/in.go @@ -0,0 +1,11 @@ +package day_21 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_22/in.go b/internal/2023/day_22/in.go new file mode 100644 index 0000000..ca4d599 --- /dev/null +++ b/internal/2023/day_22/in.go @@ -0,0 +1,11 @@ +package day_22 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_23/in.go b/internal/2023/day_23/in.go new file mode 100644 index 0000000..adf7000 --- /dev/null +++ b/internal/2023/day_23/in.go @@ -0,0 +1,11 @@ +package day_23 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_24/in.go b/internal/2023/day_24/in.go new file mode 100644 index 0000000..080004f --- /dev/null +++ b/internal/2023/day_24/in.go @@ -0,0 +1,11 @@ +package day_24 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/internal/2023/day_25/in.go b/internal/2023/day_25/in.go new file mode 100644 index 0000000..350218b --- /dev/null +++ b/internal/2023/day_25/in.go @@ -0,0 +1,11 @@ +package day_25 + +type Day struct{} + +func (d *Day) Part1(in string) string { + return "" +} + +func (d *Day) Part2(in string) string { + return "" +} diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 4b4ff6d..dfe488b 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -45,7 +45,7 @@ func GetInputData(year int, day int) string { } // Make a request to get the input from advent of code and save it in a file - url := fmt.Sprintf("https://adventofcode.com/%d/day/%d/input", year, day) + url := fmt.Sprintf("https://adventOfCode.com/%d/day/%d/input", year, day) // Read cookie session vaue session, err := os.ReadFile("./session.txt") diff --git a/run.sh b/run.sh index cda1a16..5c04736 100755 --- a/run.sh +++ b/run.sh @@ -1,3 +1,3 @@ #!/bin/sh -nodemon --quiet -e go,html,yaml --ignore web/app/ --signal SIGTERM --exec 'go run ./cmd/adventOfCode '$1' '$2' '$3' || exit 1' \ No newline at end of file +nodemon --quiet -e go,html,yaml --ignore web/app/ --signal SIGTERM --exec 'clear && go run ./cmd/adventOfCode/ '$1' '$2' '$3' || exit 1' \ No newline at end of file