Skip to content

Commit

Permalink
start day6
Browse files Browse the repository at this point in the history
  • Loading branch information
SylivanKenobi committed Dec 6, 2024
1 parent 7a236bc commit bc55924
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion 2024/day5/day5.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package day4
package day5

import (
"adventofcode/utils"
Expand Down
39 changes: 39 additions & 0 deletions 2024/day6/day6.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package day6

import (
"adventofcode/utils"
"regexp"
"strconv"
)

// Always turn right till stopped
func Part1(file string) int {
lines := utils.ReadFileByLine(file)

result := 0
upRe := regexp.MustCompile(`^`)
dwRe := regexp.MustCompile(`v`)
riRe := regexp.MustCompile(`>`)
leRe := regexp.MustCompile(`<`)
for _, line := range lines {

}
return result
}

func Part2(file string) int {
lines := utils.ReadFileByLine(file)

result := 0

return result
}

func strToIntArr(input []string) []int {
var r []int
for _, n := range input {
a, _ := strconv.Atoi(n)
r = append(r, a)
}
return r
}
10 changes: 10 additions & 0 deletions 2024/inputs/6_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
....#.....
.........#
..........
..#.......
.......#..
..........
.#..^.....
........#.
#.........
......#...
6 changes: 6 additions & 0 deletions 2024/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ( // "context"
day3 "adventofcode/day3"
day4 "adventofcode/day4"
day5 "adventofcode/day5"
day6 "adventofcode/day6"
"fmt"
)

Expand Down Expand Up @@ -37,4 +38,9 @@ func main() {
fmt.Println(day5.Part1("5_1.txt"))
fmt.Println("day 5 part 2")
fmt.Println(day5.Part2("5_1.txt"))

fmt.Println("day 6 part 1")
fmt.Println(day6.Part1("6_1.txt"))
fmt.Println("day 6 part 2")
fmt.Println(day6.Part2("6_1.txt"))
}

0 comments on commit bc55924

Please sign in to comment.