Skip to content

Commit 6b8adf2

Browse files
committed
chore: Moving go files to src folder
1 parent ec7d366 commit 6b8adf2

File tree

16 files changed

+11
-100
lines changed

16 files changed

+11
-100
lines changed

day1/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

day2/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

day3/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

day4/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

day5/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/truggeri/adventofcode2024
2+
3+
go 1.23.4

day1/main.go renamed to src/day1/day1.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package main
1+
package day1
22

33
import (
4-
"fmt"
54
"slices"
65
"strconv"
76
"strings"
@@ -10,16 +9,6 @@ import (
109
// This is a bit fragile, but the spec doesn't indicate it will ever change
1110
const INPUT_SEPARATOR = " "
1211

13-
func main() {
14-
input := `3 4
15-
4 3
16-
2 5
17-
1 3
18-
3 9
19-
3 3`
20-
fmt.Println(solve(parseInput(input)))
21-
}
22-
2312
func Solve(input string) uint {
2413
return solve(parseInput(input))
2514
}

day1/main_test.go renamed to src/day1/day1_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package day1
22

33
import (
44
"testing"

day2/main.go renamed to src/day2/day2.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package main
1+
package day2
22

33
import (
4-
"fmt"
54
"slices"
65
"strconv"
76
"strings"
@@ -13,17 +12,6 @@ const DELTA_MIN = 1
1312
type level uint
1413
type report []level
1514

16-
func main() {
17-
input := `7 6 4 2 1
18-
1 2 7 8 9
19-
9 7 6 2 1
20-
1 3 2 4 5
21-
8 6 4 4 1
22-
1 3 6 7 9`
23-
solution := Solve(input)
24-
fmt.Println("Solution:", solution)
25-
}
26-
2715
func Solve(input string) uint {
2816
return solve(parseInput(input))
2917
}

day2/main_test.go renamed to src/day2/day2_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package day2
22

33
import (
44
"testing"

day3/main.go renamed to src/day3/day3.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package main
1+
package day3
22

33
import (
4-
"fmt"
54
"regexp"
65
"slices"
76
"strconv"
@@ -20,11 +19,6 @@ func (m mul) Eval() uint {
2019
return m.x * m.y
2120
}
2221

23-
func main() {
24-
input := "xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))"
25-
fmt.Println("Solution:", Solve(input))
26-
}
27-
2822
func Solve(input string) uint {
2923
return accumulate(parseInput(input))
3024
}

day3/main_test.go renamed to src/day3/day3_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package day3
22

33
import (
44
"testing"

day4/main.go renamed to src/day4/day4.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package main
1+
package day4
22

33
import (
4-
"fmt"
54
"slices"
65
"strings"
76
"unicode/utf8"
@@ -11,20 +10,6 @@ const WORD_TO_FIND = "XMAS"
1110

1211
var _rows []string
1312

14-
func main() {
15-
input := `MMMSXXMASM
16-
MSAMXMSMSA
17-
AMXSXMAAMM
18-
MSAMASMSMX
19-
XMASAMXAMM
20-
XXAMMXXAMA
21-
SMSMSASXSS
22-
SAXAMASAAA
23-
MAMMMXMMMM
24-
MXMXAXMASX`
25-
fmt.Println("Solution:", Solve(input))
26-
}
27-
2813
func Solve(input string) uint {
2914
_rows = make([]string, 0)
3015
return matchesByStrategy(input, rows) + matchesByStrategy(input, columns) + matchesByStrategy(input, diagonals)

day4/main_test.go renamed to src/day4/day4_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package day4
22

33
import (
44
"testing"

day5/main.go renamed to src/day5/day5.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package main
22

33
import (
4-
"fmt"
54
"slices"
65
"strconv"
76
"strings"
@@ -11,38 +10,6 @@ type pageNumber uint
1110
type rule pageNumber
1211
type batch []pageNumber
1312

14-
func main() {
15-
input := `47|53
16-
97|13
17-
97|61
18-
97|47
19-
75|29
20-
61|13
21-
75|53
22-
29|13
23-
97|29
24-
53|29
25-
61|53
26-
97|53
27-
61|29
28-
47|13
29-
75|47
30-
97|75
31-
47|61
32-
75|61
33-
47|29
34-
75|13
35-
53|13
36-
37-
75,47,61,53,29
38-
97,61,53,29,13
39-
75,29,13
40-
75,97,47,61,53
41-
61,13,29
42-
97,13,75,29,47`
43-
fmt.Println("Solution:", Solve(input))
44-
}
45-
4613
func Solve(input string) uint {
4714
rules, batches := parseInput(input)
4815
var count uint = 0
File renamed without changes.

0 commit comments

Comments
 (0)