Cleanup and reorganization
This commit is contained in:
1 parent
0af5c11e6d
commit
2107b9c990
20 files changed
+158
-215
No files matched your search
@@ -234,7 +234,6 @@ func visit(farmMap Map, field Visited, x int, y int, value rune) {
|
||||
}
|
||||
|
||||
func loadMap(input string) Map {
|
||||
input = strings.ReplaceAll(input, "\r", "")
|
||||
topographicMap := Map{}
|
||||
for _, line := range strings.Split(input, "\n") {
|
||||
topographicMap = append(topographicMap, []rune(line))
|
||||
|
||||
+4
-12
@@ -2,6 +2,7 @@ package day_12_test
|
||||
|
||||
import (
|
||||
"advent_of_code_2024/day_12"
|
||||
"advent_of_code_2024/helpers"
|
||||
_ "embed"
|
||||
"testing"
|
||||
)
|
||||
@@ -13,22 +14,13 @@ var ExampleData string
|
||||
var ExampleData01 string
|
||||
|
||||
func TestBasicSolutionExample(t *testing.T) {
|
||||
result := day_12.SolveBasic(ExampleData)
|
||||
if result != 1930 {
|
||||
t.Fatalf("Expected 1930 received %d", result)
|
||||
}
|
||||
helpers.Check(t, day_12.SolveBasic, helpers.Format(ExampleData), 1930)
|
||||
}
|
||||
|
||||
func TestComplexSolutionExample(t *testing.T) {
|
||||
result := day_12.SolveComplex(ExampleData)
|
||||
if result != 1206 {
|
||||
t.Fatalf("Expected 1206 received %d", result)
|
||||
}
|
||||
helpers.Check(t, day_12.SolveComplex, helpers.Format(ExampleData), 1206)
|
||||
}
|
||||
|
||||
func TestComplexSolutionExample01(t *testing.T) {
|
||||
result := day_12.SolveComplex(ExampleData01)
|
||||
if result != 80 {
|
||||
t.Fatalf("Expected 80 received %d", result)
|
||||
}
|
||||
helpers.Check(t, day_12.SolveComplex, helpers.Format(ExampleData01), 80)
|
||||
}
|
||||
Reference in new issue
Block a user