Compare commits

..

11 Commits

Author SHA1 Message Date
Simon Ziegler
500de11910 tried stuff - nothing works yet 2025-12-11 17:58:03 +01:00
Simon Ziegler
aee88264c5 day 08 part 2 2025-12-11 14:57:47 +01:00
Simon Ziegler
4e26c55eb7 day 08 part 1 2025-12-11 14:22:11 +01:00
Simon Ziegler
46c27fd8a6 worked on day 02 part2 2025-12-10 16:47:48 +01:00
Simon Ziegler
a05cb9d41f day 09 - part 1 2025-12-10 16:29:34 +01:00
Simon Ziegler
80ae5ea954 day 07 part 2 2025-12-10 14:37:59 +01:00
Simon Ziegler
65a974ba95 Merge branch 'main' of git.z1glr.de:z1glr/advent-of-code-2025 2025-12-09 17:33:09 +01:00
Simon Ziegler
80a15f49c4 moved to correct dir 2025-12-09 17:33:05 +01:00
Simon Ziegler
2af9222a19 more work on 07 2025-12-09 17:31:11 +01:00
z1glr
2b78ac2eff day 07 part 1 works, 2 too slow 2025-12-09 13:05:23 +01:00
z1glr
8da2c12663 day 06 2025-12-08 20:38:20 +01:00
15 changed files with 2713 additions and 47 deletions

View File

@@ -4,7 +4,6 @@ import (
"fmt"
"math"
"os"
"strconv"
"strings"
)
@@ -13,22 +12,18 @@ func countJoltage(i int, rows *[][]int) int {
for _, rowNumbers := range *rows {
index := 0
thisJoltage := 0
for digitPlace := range i {
index = int(math.Max(float64(index), float64(digitPlace)))
for candidate := index; candidate <= len(rowNumbers)-i+digitPlace; candidate++ {
if rowNumbers[candidate] > rowNumbers[index] {
index = candidate
}
}
thisJoltage += rowNumbers[index] * int(math.Pow10(i-digitPlace-1))
totalJoltage += rowNumbers[index] * int(math.Pow10(i-digitPlace-1))
index++
}
totalJoltage += thisJoltage
}
return totalJoltage
@@ -66,11 +61,3 @@ func loadData(test bool) string {
return strings.TrimSpace(string(cont))
}
}
func parseInt(s string) int {
if ii, err := strconv.Atoi(s); err != nil {
panic(err)
} else {
return ii
}
}

View File

@@ -7,15 +7,17 @@ import (
"git.z1glr.de/advent-of-code-2025/pkg/aoc"
)
func do(test bool) int {
func do(test bool) (int, int) {
inputRows := aoc.ReadFileRows(test)
operators := strings.Fields(inputRows[len(inputRows)-1])
return do1(&inputRows), do2(&inputRows)
}
tdNumberStrings := make([]byte, len(inputRows[0]))
func do1(inputRows *[]string) int {
operators := strings.Fields((*inputRows)[len(*inputRows)-1])
numbers := make([][]int, len(inputRows)-1)
for ii, row := range inputRows[:len(inputRows)-1] {
numbers := make([][]int, len(*inputRows)-1)
for ii, row := range (*inputRows)[:len(*inputRows)-1] {
numberStrings := strings.Fields(row)
numbers[ii] = make([]int, len(numberStrings))
@@ -25,53 +27,76 @@ func do(test bool) int {
}
}
for ii := range len(inputRows[0]) {
for jj := 0; jj < len(inputRows)-1; jj++ {
tdNumberStrings[ii] = inputRows[ii][jj]
}
}
tdNumbers := make([][]int, len(operators))
currentOperation := 0
for _, number := range tdNumberStrings {
if strings.TrimSpace(string(number)) == "" {
currentOperation++
} else {
tdNumbers[currentOperation] = append(tdNumbers[currentOperation], aoc.ParseInt(string(number)))
}
}
grandSum := 0
grandSum2 := 0
for ii, operator := range operators {
switch operator {
case "+":
for jj := range len(numbers) {
grandSum += numbers[jj][ii]
grandSum2 += tdNumbers[jj][ii]
}
case "*":
columnResult := 1
columnResult2 := 1
for jj := range len(numbers) {
columnResult *= numbers[jj][ii]
columnResult2 *= tdNumbers[jj][ii]
}
grandSum += columnResult
grandSum2 += columnResult2
}
}
fmt.Println(grandSum)
fmt.Println(grandSum2)
return grandSum
}
func do2(inputRows *[]string) int {
operators := strings.Fields((*inputRows)[len(*inputRows)-1])
numberStrings := make([]string, len((*inputRows)[0]))
for _, row := range (*inputRows)[:len(*inputRows)-1] {
for iNumber, number := range row {
numberStrings[iNumber] += string(number)
}
}
numbers := [][]int{{}}
for _, numberString := range numberStrings {
cleanedString := strings.ReplaceAll(numberString, " ", "")
if cleanedString == "" {
numbers = append(numbers, []int{})
} else {
numbers[len(numbers)-1] = append(numbers[len(numbers)-1], aoc.ParseInt(cleanedString))
}
}
grandTotal := 0
for ii, numberPackage := range numbers {
switch operators[ii] {
case "+":
sum := 0
for _, number := range numberPackage {
sum += number
}
grandTotal += sum
case "*":
product := 1
for _, number := range numberPackage {
product *= number
}
grandTotal += product
}
}
fmt.Println(grandTotal)
return grandTotal
}
func main() {
if do(true) == 4277556 {
if res1, res2 := do(true); res1 == 4277556 && res2 == 3263827 {
do(false)
}
}

142
07/input Normal file
View File

@@ -0,0 +1,142 @@
......................................................................S......................................................................
.............................................................................................................................................
......................................................................^......................................................................
.............................................................................................................................................
.....................................................................^.^.....................................................................
.............................................................................................................................................
....................................................................^.^.^....................................................................
.............................................................................................................................................
...................................................................^.^.^.^...................................................................
.............................................................................................................................................
..................................................................^.....^.^..................................................................
.............................................................................................................................................
.................................................................^...^.^...^.................................................................
.............................................................................................................................................
................................................................^.^.^.^.....^................................................................
.............................................................................................................................................
...............................................................^...^.^.......^...............................................................
.............................................................................................................................................
..............................................................^.^.^.^.........^..............................................................
.............................................................................................................................................
.............................................................^.^...^.^.^.^.^.^.^.............................................................
.............................................................................................................................................
............................................................^.^.^.^.^...^.^.^.^.^............................................................
.............................................................................................................................................
...........................................................^.^.^.......^.^.^.^.^.^...........................................................
.............................................................................................................................................
..........................................................^.^.^.^.^...^...^.^.^.^.^..........................................................
.............................................................................................................................................
.........................................................^...^.......^.^.^.^...^...^.........................................................
.............................................................................................................................................
........................................................^.^.....^...^.^...^...^.^...^........................................................
.............................................................................................................................................
.......................................................^.^...^.^.^.^...^.^...^.^.....^.......................................................
.............................................................................................................................................
......................................................^.^...^.....^.^.^...^.^.^...^.^.^......................................................
.............................................................................................................................................
.....................................................^.^.^...^.^.^.^.^.^.^...^.^...^.^.^.....................................................
.............................................................................................................................................
....................................................^.^.........^...^.^.^.^...^.^.^.^.^.^....................................................
.............................................................................................................................................
...................................................^.....^...^.^...^.^.^...^.^.......^.^.^...................................................
.............................................................................................................................................
..................................................^.^...^.^.^.^...^.^.^.....^.....^.^.^...^..................................................
.............................................................................................................................................
.................................................^.^.^.^.^.^.^.^...^.^.^.^...^...^.^.^...^.^.................................................
.............................................................................................................................................
................................................^.^.....^.....^.^.....^...^.^...^.^.......^.^................................................
.............................................................................................................................................
...............................................^.^...^.^...^.^.....^.^.^.^.^.^...^.^...^.^.^.^...............................................
.............................................................................................................................................
..............................................^...^.^.^...^.....^...^.^.^.....^.^...^...^.^...^..............................................
.............................................................................................................................................
.............................................^.^.^.^.^.^.^.^.^.......^.^.^.^.^.^.^.^...^.^.^.^.^.............................................
.............................................................................................................................................
............................................^.^.^.^.^.^.....^...^.^.^.^.^.^...^...^.^.^...^.^.^.^............................................
.............................................................................................................................................
...........................................^.^...^.^.^.^.^...^.^.^.^.....^.....^.....^.......^.^.^...........................................
.............................................................................................................................................
..........................................^.^...^.^.^.^...^.^.^.^.^.^...^.^.....^.^.^.......^.^.^.^..........................................
.............................................................................................................................................
.........................................^.^.^.^.^.^.^...^.^...^.^.^...^...^.^...^...^.......^.^.^.^.........................................
.............................................................................................................................................
........................................^.^.....^.^...^.^.^...^.^.^...^.^...^.^.^...^.^.^.^.^.^.^...^........................................
.............................................................................................................................................
.......................................^...^.....^...^.^.^.^...^...^...^.^...^.^...^.^.^...^.^.^.^.^.^.......................................
.............................................................................................................................................
......................................^.^.^...^.^.^.^.^.^.^.^.^.^.....^.^...^.^.^.^.^...^.^.^.^.^.^.^.^......................................
.............................................................................................................................................
.....................................^.^.....^.....^.....^.^.^.^...^.^...^.^.^.^.^.^.....^.^.^.^.^.^.^.^.....................................
.............................................................................................................................................
....................................^.^...^.^.^.^...^.^.^.^.^.^.^.^...^.^.^...^.^.^.^...^.^...^...^.^.^.^....................................
.............................................................................................................................................
...................................^.....^.....^.^.^.^.^.....^...^.^.^.^.^...^...^.....^.^.^...^.^.^.....^...................................
.............................................................................................................................................
..................................^...^...^...^.^.^.^...^.......^.^...^.^.......^.^.^.^...^.^.....^.^.^...^..................................
.............................................................................................................................................
.................................^.^.^.^.^.^.^.^.^.^...^.^.^.^.....^.^.^.^.^.^.^.......^.^.^...^...^...^.^.^.................................
.............................................................................................................................................
................................^.^.^.^.^.^.^.^.^.^.^...^.^...^.....^.^.^...^.^...^...^.^...^.^...^.^.^.^.^.^................................
.............................................................................................................................................
...............................^.^.....^.^.^.^.^.^.^.....^.^.^.^.^.^.^.^.^.^.^.....^.^.^.^.^.^.^.^.^.^.^...^.^...............................
.............................................................................................................................................
..............................^.^.^.^.^.^.^.^.^.........^.^.^.^.^.^.^.^...^.^...^.^.^.^.^.^.......^.^.^.....^.^..............................
.............................................................................................................................................
.............................^...^...^.^.^.^...^.^...^.^.^.^.^.^.^...^.^...^.^.^.^.^.....^...^.^...^.^.^.^.^.^.^.............................
.............................................................................................................................................
............................^.^.^.^.^...^.....^...^...^.^.....^.....^...^...^.^.^.....^.^.^.^.^...^.^.^.^.^.^.^.^............................
.............................................................................................................................................
...........................^.^.^.^.^.....^.^.^...^.....^...^...^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.....^.^.^.^.^.....^...........................
.............................................................................................................................................
..........................^.^.^.^.^.^.^.^.^.^...^.^.^.^...^.....^.^.....^.....^.^...^...^.^.^...^.^.^.^.^.^.^.^.^.^..........................
.............................................................................................................................................
.........................^.^.^.^.^.^.^.....^...^.^.^.........^.^.......^.^...^.^.^...^.^.^.^.^.^.....^.^.^...^...^.^.........................
.............................................................................................................................................
........................^.^.^.^.....^.^...^.^.^...^.^...^...^.^.^.^.^.^.....^.^.^...^...^.^.^.^.^.^.^...^.^...^...^.^........................
.............................................................................................................................................
.......................^.^.^...^.^.^.^.^.....^...^.^.^...^...^.^.^.^.^...^.^.^...^...^.^.....^.^.^.^.^.^.^.^...^.^.^.^.......................
.............................................................................................................................................
......................^...^...^.^.^.........^...^.^.^.^...^.^.^...^.^.^...^.^...^.^...^.....^.^.^.^.^.^.......^.^.^.^.^......................
.............................................................................................................................................
.....................^...^.^.....^.^...^.......^.....^.^.^.^.^.....^.^.^.^.^.....^.^.^.^.^.^.^...^...^.^.^...^.........^.....................
.............................................................................................................................................
....................^...^.^.^.....^...^.^.^.^.....^.^.^.^.^.^.^.^...^.^.^.^...^.^.^...^.^.^.^.^...^.^.^.....^.^.^.^.^...^....................
.............................................................................................................................................
...................^...^.^.^.^.^.^.^.^.^.^.^.^.^.^.^...........^.^.^...^.^.^.^.^.^.^.....^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.^...................
.............................................................................................................................................
..................^...^.^.^.^.^.^.^.......^.^.^.^.......^.^.^.^.....^.^...^.^.^.^...^.^.....^.^...^...^.^.^...^...^.^.^.^.^..................
.............................................................................................................................................
.................^.^.^.^.^...^.......^.^...^.^...^.^...^.....^.^.^.^.....^.^.^.^.^.^.^...^.^.....^.^.^.^.^.....^.^.^.^.^...^.................
.............................................................................................................................................
................^.^...^.^.^.^.^.^.^...^...^.^.^.^.^.^...^.^...^.^...^.....^.^...^...^...^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^................
.............................................................................................................................................
...............^.^.^.^...^.^.^...^.^.^.^.^...^...^...^.^...^.^.......^.......^.^...^...^.^...^.^.^.^...^.^.^.^...^.......^.^.^...............
.............................................................................................................................................
..............^.^...^.^...^.^.^.^.^...^.^.^...^.^...^.^.^...^.^.........^.^.^...^.^.^.^.^.....^.^.^.^.^...^...^.^.^.^.^.....^.^..............
.............................................................................................................................................
.............^.^.^.....^.^.^...^...^.^.....^.^.....^...^.^.....^.^.^.^.^.....^.^.^.^.....^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.............
.............................................................................................................................................
............^.....^.^...^...^.^.^.^.^.^.^.^...^.....^.^...^...^.^.^.^.^.^.^.^.....^.^.^.^...^.^...^.^...^.^.^.^.^...^.^.^.......^............
.............................................................................................................................................
...........^.^.^.^...^.^.^.^.^.^.^.^.^.....^.^...^.^...........^.......^.^.^.^.....^.^...^.^.^.^.^.^.....^...^.....^...^.^.^.^.^.^...........
.............................................................................................................................................
..........^...^.^.^...^.^.^.^...^...^...^.^.^.^...^.^.....^...^.^.^.^.^.^.........^...^...^.^...^...^.^.^...^.^...^.....^...^.^.^.^..........
.............................................................................................................................................
.........^.............^.^.^...^.^.^.^.^.....^.^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.^.^...^...^...^.^.^.^.^.^.^.^.^.^...^...^...^...^.^.^.........
.............................................................................................................................................
........^.^...^...^.^.^.^...^.....^...^...^.^.^.^.....^.^.^.....^.^.^.^.^.^.^.^...^.^.^.....^...^.^.^...^.^...^.^.^...^.^.^...^...^.^........
.............................................................................................................................................
.......^.^.^.^...^.^.^.^.^.^.^...^...^.^.^.^.^.^.^...^.^.^.^.^.^.^.^...^...^.^.^.^...^.^.^.^.^...^.^.^...^.......^...^.^.^.....^.....^.......
.............................................................................................................................................
......^.^.....^.^...^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^...^...^.^.^.....^.^.....^.....^...^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^.^.^.^......
.............................................................................................................................................
.....^...^.^...^.^.^.....^.^.^.........^.^.^.^.^...^...^.^.^...^.^.^.^.^.^.^.^.^...^...^.^.^.^.^...^.....^.^.^.....^.....^.....^.^...^.^.....
.............................................................................................................................................
....^.....^.^.^.......^.^.....^.^.^.^...^...^.^.^.^...^.^.^.^...^.^.^.......^.^.^.^.^.....^.^...^.^.^.^.^...^.^.^.^...^.^.^.^...^.....^.^....
.............................................................................................................................................
...^.^...^.......^.^.^.^...^.^.....^.^.^.^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.^...^.^.^...^.^.^.^.^.^...^.^.^.^.^.^...^.^...^.....^...^.^...^...
.............................................................................................................................................
..^.......^.^.^.^.....^.^.......^.^.^...^...^.........^.......^.^...^...^.^.......^...^.^.........^.^...^.^.^.^.^.^.^.^.^...^...^...^...^.^..
.............................................................................................................................................
.^.^...^.^.^.^.^.^.^...^.^.^.^.^.^.^...^.^...^.^.^.^.....^.....^.........^...^.^.^.^...^.^.^.^.^.^.^.^.^.^.^...^.^.....^.^.^.^.^.^.^.....^.^.
.............................................................................................................................................

74
07/main.go Normal file
View File

@@ -0,0 +1,74 @@
package main
import (
"fmt"
"strings"
"git.z1glr.de/advent-of-code-2025/pkg/aoc"
)
type Schematic struct {
rows []string
timelines [][]int
splits int
}
func (s *Schematic) Calculate() {
startIndex := strings.Index(s.rows[0], "S")
s.timelines = make([][]int, len(s.rows))
for ii, rr := range s.rows {
s.timelines[ii] = make([]int, len(rr))
}
s.timelines[0][startIndex] = 1
s.CalculateRow(0)
}
func (s *Schematic) CalculateRow(i int) {
if i == len(s.rows)-1 {
return
}
for ii, count := range s.timelines[i] {
switch s.rows[i+1][ii] {
case byte('^'):
s.timelines[i+1][ii-1] += count
s.timelines[i+1][ii+1] += count
if s.timelines[i][ii] > 0 {
s.splits++
}
default:
s.timelines[i+1][ii] += count
}
}
s.CalculateRow(i + 1)
}
func do(test bool) (int, int) {
schematic := Schematic{
rows: aoc.ReadFileRows(test),
}
schematic.Calculate()
timelineCount := 0
for _, cc := range schematic.timelines[len(schematic.timelines)-1] {
timelineCount += cc
}
fmt.Println(schematic.splits)
fmt.Println(timelineCount)
return schematic.splits, timelineCount
}
func main() {
if r1, r2 := do(true); r1 == 21 && r2 == 40 {
do(false)
}
}

16
07/test Normal file
View File

@@ -0,0 +1,16 @@
.......S.......
...............
.......^.......
...............
......^.^......
...............
.....^.^.^.....
...............
....^.^...^....
...............
...^.^...^.^...
...............
..^...^.....^..
...............
.^.^.^.^.^...^.
...............

1000
08/input Normal file

File diff suppressed because it is too large Load Diff

147
08/main.go Normal file
View File

@@ -0,0 +1,147 @@
package main
import (
"fmt"
"math"
"sort"
"strings"
"git.z1glr.de/advent-of-code-2025/pkg/aoc"
)
type Node struct {
X, Y, Z int
root *Node
Size int
ID int
}
func (p *Node) DistanceTo(p2 *Node) float64 {
return math.Sqrt(float64((p.X-p2.X)*(p.X-p2.X) + (p.Y-p2.Y)*(p.Y-p2.Y) + (p.Z-p2.Z)*(p.Z-p2.Z)))
}
func (p *Node) GetRoot() *Node {
if p.root == nil {
return p
} else {
root := p.root.GetRoot()
p.root = root
return root
}
}
func PointFromString(s string) Node {
parts := strings.Split(s, ",")
return Node{
X: aoc.ParseInt(parts[0]),
Y: aoc.ParseInt(parts[1]),
Z: aoc.ParseInt(parts[2]),
Size: 1,
}
}
type Connection struct {
Length float64
P1, P2 *Node
}
func do(test bool) (int, int) {
rows := aoc.ReadFileRows(test)
points := make([]Node, len(rows))
for ii, rr := range rows {
points[ii] = PointFromString(rr)
points[ii].ID = ii + 1
}
connections := []Connection{}
for ii := range points[:len(points)-1] {
for jj := ii + 1; jj < len(points); jj++ {
// for jj := range points[ii+1:] {
p1 := &points[ii]
p2 := &points[jj]
// p2 := &points[ii+1+jj]
connections = append(connections, Connection{
Length: p1.DistanceTo(p2),
P1: p1,
P2: p2,
})
}
}
// sort distances by length
sort.Slice(connections, func(i, j int) bool { return connections[i].Length < connections[j].Length })
threshold := 1000
if test {
threshold = 10
}
var res1, res2 int
for ii := range connections {
if ii == threshold {
roots := []*Node{}
for ii := range points {
pp := &points[ii]
if pp.GetRoot() == pp {
roots = append(roots, pp)
}
}
sort.Slice(roots, func(i, j int) bool { return roots[i].Size > roots[j].Size })
res1 = roots[0].Size * roots[1].Size * roots[2].Size
fmt.Println(res1)
} else if ii > threshold {
cc := connections[ii-1]
// check wether it is one big circuit
root := points[0].GetRoot()
multipleCircuits := false
for jj := range points[1:] {
pp := &points[jj]
if pp.GetRoot() != root {
multipleCircuits = true
break
}
}
if !multipleCircuits {
res2 = cc.P1.X * cc.P2.X
fmt.Println(res2)
break
}
}
cc := &connections[ii]
root1 := cc.P1.GetRoot()
root2 := cc.P2.GetRoot()
if root1 != root2 {
root2.root = root1
root1.Size += root2.Size
}
}
return res1, res2
}
func main() {
if r1, r2 := do(true); r1 == 40 && r2 == 25272 {
do(false)
}
}

20
08/test Normal file
View File

@@ -0,0 +1,20 @@
162,817,812
57,618,57
906,360,560
592,479,940
352,342,300
466,668,158
542,29,236
431,825,988
739,650,466
52,470,668
216,146,977
819,987,18
117,168,530
805,96,715
346,949,466
970,615,88
941,993,340
862,61,35
984,92,344
425,690,689

496
09/input Normal file
View File

@@ -0,0 +1,496 @@
98302,50003
98302,51224
98168,51224
98168,52447
98186,52447
98186,53636
97714,53636
97714,54871
97875,54871
97875,56010
97164,56010
97164,57213
97068,57213
97068,58476
97274,58476
97274,59728
97321,59728
97321,60896
96940,60896
96940,62063
96580,62063
96580,63178
96044,63178
96044,64395
95871,64395
95871,65536
95443,65536
95443,66593
94793,66593
94793,67818
94599,67818
94599,68765
93720,68765
93720,69885
93270,69885
93270,70946
92694,70946
92694,72389
92855,72389
92855,73409
92168,73409
92168,74440
91512,74440
91512,75135
90319,75135
90319,76590
90340,76590
90340,77609
89661,77609
89661,78603
88946,78603
88946,79150
87653,79150
87653,80056
86856,80056
86856,80969
86069,80969
86069,82283
85727,82283
85727,82920
84627,82920
84627,83969
83964,83969
83964,84620
82904,84620
82904,85831
82367,85831
82367,86713
81513,86713
81513,87151
80288,87151
80288,87866
79306,87866
79306,88852
78525,88852
78525,89142
77239,89142
77239,89703
76163,89703
76163,90454
75211,90454
75211,91706
74547,91706
74547,92126
73378,92126
73378,92726
72314,92726
72314,93055
71115,93055
71115,93445
69958,93445
69958,93971
68866,93971
68866,94264
67677,94264
67677,95294
66771,95294
66771,95514
65553,95514
65553,96011
64432,96011
64432,96160
63204,96160
63204,96700
62088,96700
62088,97050
60914,97050
60914,96668
59587,96668
59587,97561
58520,97561
58520,97113
57214,97113
57214,97472
56042,97472
56042,97372
54813,97372
54813,98058
53656,98058
53656,97675
52414,97675
52414,98174
51217,98174
51217,97538
49996,97538
49996,97777
48785,97777
48785,97710
47577,97710
47577,97588
46372,97588
46372,98126
45102,98126
45102,97628
43930,97628
43930,97893
42659,97893
42659,96979
41576,96979
41576,97336
40268,97336
40268,96764
39144,96764
39144,96153
38046,96153
38046,96044
36821,96044
36821,96133
35522,96133
35522,95129
34570,95129
34570,94715
33435,94715
33435,94476
32230,94476
32230,94173
31039,94173
31039,93855
29845,93855
29845,93309
28751,93309
28751,92364
27866,92364
27866,91768
26813,91768
26813,90974
25875,90974
25875,90656
24654,90656
24654,90390
23376,90390
23376,89775
22311,89775
22311,88714
21567,88714
21567,88174
20446,88174
20446,87381
19515,87381
19515,86667
18517,86667
18517,85391
18020,85391
18020,84587
17117,84587
17117,84173
15821,84173
15821,83232
15034,83232
15034,82204
14349,82204
14349,81581
13206,81581
13206,80333
12794,80333
12794,79174
12304,79174
12304,78538
11129,78538
11129,77208
10902,77208
10902,76567
9682,76567
9682,75520
9049,75520
9049,74331
8659,74331
8659,73210
8176,73210
8176,72066
7748,72066
7748,71330
6507,71330
6507,70084
6280,70084
6280,68785
6215,68785
6215,67814
5393,67814
5393,66621
5112,66621
5112,65682
4109,65682
4109,64454
3918,64454
3918,63076
4289,63076
4289,62035
3502,62035
3502,60858
3190,60858
3190,59573
3400,59573
3400,58531
2382,58531
2382,57313
2238,57313
2238,56105
2034,56105
2034,54836
2406,54836
2406,53666
1803,53666
1803,52448
1646,52448
1646,51221
1674,51221
1674,50003
94601,50003
94601,48785
2222,48785
2222,47553
1818,47553
1818,46337
1944,46337
1944,45177
2609,45177
2609,43968
2666,43968
2666,42764
2790,42764
2790,41575
3015,41575
3015,40249
2568,40249
2568,39132
3184,39132
3184,37906
3307,37906
3307,36927
4324,36927
4324,35567
4011,35567
4011,34363
4265,34363
4265,33197
4640,33197
4640,32194
5435,32194
5435,31142
6065,31142
6065,30099
6695,30099
6695,28705
6596,28705
6596,27761
7433,27761
7433,26844
8288,26844
8288,25449
8300,25449
8300,24396
8928,24396
8928,23840
10314,23840
10314,22721
10814,22721
10814,21729
11506,21729
11506,20366
11722,20366
11722,19560
12674,19560
12674,18574
13398,18574
13398,17557
14096,17557
14096,17268
15571,17268
15571,15972
15976,15972
15976,15218
16942,15218
16942,14403
17844,14403
17844,13244
18451,13244
18451,13003
19837,13003
19837,12032
20615,12032
20615,11292
21581,11292
21581,10689
22643,10689
22643,10214
23783,10214
23783,9256
24608,9256
24608,8332
25475,8332
25475,7886
26628,7886
26628,7649
27881,7649
27881,7321
29068,7321
29068,6086
29826,6086
29826,6310
31254,6310
31254,5316
32154,5316
32154,4703
33227,4703
33227,4507
34453,4507
34453,4398
35695,4398
35695,3408
36672,3408
36672,3522
37969,3522
37969,3685
39256,3685
39256,3353
40417,3353
40417,2886
41559,2886
41559,2933
42793,2933
42793,2141
43908,2141
43908,2680
45191,2680
45191,2586
46392,2586
46392,2000
47569,2000
47569,2086
48789,2086
48789,1768
50003,1768
50003,2094
51217,2094
51217,1726
52451,1726
52451,2521
53618,2521
53618,2184
54865,2184
54865,2001
56116,2001
56116,2192
57327,2192
57327,2984
58430,2984
58430,2640
59735,2640
59735,3676
60752,3676
60752,3891
61941,3891
61941,4311
63076,4311
63076,4651
64231,4651
64231,4383
65595,4383
65595,4870
66717,4870
66717,5195
67900,5195
67900,6130
68829,6130
68829,6542
69971,6542
69971,6459
71361,6459
71361,7583
72160,7583
72160,7855
73395,7855
73395,8368
74511,8368
74511,9474
75263,9474
75263,9687
76572,9687
76572,10635
77402,10635
77402,11650
78164,11650
78164,11759
79604,11759
79604,12930
80230,12930
80230,13733
81138,13733
81138,14741
81859,14741
81859,15311
82978,15311
82978,16332
83672,16332
83672,17169
84542,17169
84542,17714
85740,17714
85740,18612
86566,18612
86566,19436
87488,19436
87488,20859
87651,20859
87651,21393
88962,21393
88962,22570
89415,22570
89415,23635
90009,23635
90009,24534
90862,24534
90862,25593
91467,25593
91467,26849
91716,26849
91716,27581
92925,27581
92925,28721
93386,28721
93386,29770
94036,29770
94036,31222
93764,31222
93764,32377
94126,32377
94126,33274
95169,33274
95169,34393
95668,34393
95668,35730
95490,35730
95490,36882
95855,36882
95855,38072
96081,38072
96081,39252
96327,39252
96327,40429
96585,40429
96585,41595
96912,41595
96912,42771
97206,42771
97206,43958
97461,43958
97461,45166
97568,45166
97568,46336
98146,46336
98146,47589
97604,47589
97604,48791
97828,48791
97828,50003

70
09/main.go Normal file
View File

@@ -0,0 +1,70 @@
package main
import (
"fmt"
"math"
"strings"
"git.z1glr.de/advent-of-code-2025/pkg/aoc"
)
type Point struct {
X, Y int
}
type Rect struct {
P1, P2 *Point
}
func (r Rect) Area() float64 {
return math.Abs(float64((r.P1.X - r.P2.X + 1) * (r.P1.Y - r.P2.Y + 1)))
}
func do(test bool) (int, int) {
rows := aoc.ReadFileRows(test)
points := make([]Point, len(rows))
for ii, rr := range rows {
parts := strings.Split(rr, ",")
points[ii] = Point{
X: aoc.ParseInt(parts[0]),
Y: aoc.ParseInt(parts[1]),
}
}
largestArea := 0
largestArea2 := 0
rects := make([]*Rect, len(points)*(len(points)+1)/2)
for ii := range points {
for jj := range points[ii+1:] {
rects[ii+jj+1] = &Rect{
P1: &points[ii],
P2: &points[jj+ii+1],
}
}
}
for ii := range rects {
rr := &rects[ii]
// iterate all others
for jj := range rects {
if jj != ii {
}
}
}
fmt.Printf("%9.0f\n", largestArea)
return int(largestArea), 0
}
func main() {
if r1, r2 := do(true); r1 == 50 && r2 == 0 {
do(false)
}
}

8
09/test Normal file
View File

@@ -0,0 +1,8 @@
7,1
11,1
11,7
9,7
9,5
2,5
2,3
7,3

585
11/input Normal file
View File

@@ -0,0 +1,585 @@
jcy: qqq xzi wqn tga eoa dki jjn xyo ywb kor ous mni gkm
ewa: qww tln
wns: lin
ldh: rnx zzx tpx
opp: xed
ahr: rnw
ues: ooa jcy cub
zgm: pxj
nvs: ztn abt
vxm: nwe
lix: wii
zsd: jdr xcr
gms: lqa siz kbp
wvv: xed kxy
qop: mfc
xyw: htg srd vpq cnn icw dfv pav yjs svm axd lqs ntk kgx mbv uzf czy hpv ysj rok aso rpf qlq eai
ruj: pcd qkg
oyz: rqd dwz tes tdq eeo mqm jzd sti wdx vak ruj omj gjk atk lmv jkd otz pdl rnk nvs dpn xva ils cgd mtp dyd
bbu: yza lbs wnt
rye: jcy bid
gaq: inl pmh bey ofx pof asv ohv nkx kao mpg
vpq: wgo
fuj: gci dly
knm: bpb vyn
taw: saj oli yga fco
mbm: ooa cub
ozq: led gni
igf: fgg mhd arm
nwl: psk tnb
egc: ysw xrt
meq: nju xed
ved: dfi gor zsd
vub: may
cae: tlf jds qki mrg
gki: mjz pss
gym: vja
tan: oli yga cgq
zno: nju kxy
kpa: iep hmf ufu cmc
ctp: ktj tft
eds: lgb ony
hni: gor zsd
rej: zrr rwt sdm
wst: igv qqg meq nwe
gju: kts nfm
whc: omw xry pcz
kxy: ebu jjk haj eom fau ixr tlo ttm apc qda blh
fes: rlt ldh
hsx: out
bcp: yhv uyb oyz
nju: qnr poc cbn akc hmx haj ebu yez ixr bjr vaz tlo eom fau
dni: cin xyw mfc
zpi: swo ymg isk
gbg: msf svn bgp
iep: bid jcy cub
fct: cjp tgk
ovp: aqd nkd ocg
qoi: ktn fft
wei: lfd wvv
qda: gqr kyg qoi
jzd: oqh mxu
ukm: oim fwq ntx
dof: nwa jed tif
zpb: zne fdm
sei: nhd
nkd: gaz qcx uft
iag: xnv vke
xrt: plt
lfd: kxy
mga: htl uft qcx gaz
szf: ooa
vbw: ooa jcy cub
gho: svn msf bgp
wlw: ive wvv
psk: gbg vvk
peg: psk tnb nhd
ebu: gyo qqp
cbn: cvv klx
xob: xed nju
qlq: crj
rrs: ymt egc fft gjs
bie: xis trn
qrb: trn bbu skd
xry: zyz qic
fwq: zno dxf
qqp: tlf mjr jds mrg
vkm: kxy nju
qtl: out
oek: igf
tun: ykg tgk cjp
dac: sxv emj
htg: izo sho btt bli
vwx: tft ktj pdq
ymd: mjz dsv pss
lkk: kpe
tlo: fmk
mvv: urx
alh: ooa cub
kjo: hbl
ztd: zpi
blh: bie gwt qrb
asv: kbp siz mkn
rsk: kpa dob ctf
ctf: ufu iep
hpv: rfb
cot: zrr sdm
nfw: raa dac lix cpl
jds: cmv
qxa: cin mfc
auh: cub ooa
drh: nog wia qww
lto: way pgj dfi gor
cii: ojz urx
mkn: unc
cmc: ooa jcy cub
mcv: mkn siz lqa
sxv: tgk ykg cjp
iyx: ahy wlw
kmv: bna gkh
cmz: bjj mfc xyw
fsk: ffa hbl tan
xvx: inl gms bey pmh ofx mpg sha wzh fuo pof mcv xpe kao ahr
lkc: tgk ykg you cjp
sds: vae bgp
qug: bjj
wuo: llf
mjz: tif hmc txn nwa jed
fuo: vxm
cin: yjs rxt srd dfv aso eai axd
vak: huw gki nsb ymd
ffa: cgq oli fco yga saj
gni: qzv efw
qqa: igv vkm qqg
dfv: ojz
yct: oyz qlj
oli: tun
pcz: qic zyz ufi
xcf: raa dac cpl
oae: uyb yhv
otz: uso chy
zrr: out
wjp: bhs yck
wgo: ehw
ybb: yon ldu nwb
mtp: oqh rfk
poc: cvv sfd
fno: gkl fjv jcm
arm: ddi wjp
bey: ovo rnw rmn awz kmv
kpe: uft qcx htl gwu gaz
yow: kpa dob
gyo: tlf mjr qki mrg
cvv: bcp mtf jdq asj
hcc: qlj uyb oyz
wia: cjp
gor: jdr nim xcr
kgx: ekb viq
vja: ztd vca lnv
kao: vts plr bqf
wzh: wst ybq ehu
vny: bey inl gms mpg nkx ohv ofx fuo wzh ahr nee kao xpe asv mcv pof
vts: yrh
hjd: out
teg: eds
bwj: nni
yez: qrb gwt
oyg: fjv jcm upm
yvj: yct wul rhq vke
fgg: hzg ddi qae skk
poh: nfw zpz xcf
aso: gij wgo
vcs: eqo mau nar
ikl: nfm bvm
eqo: xyw cin bjj mfc
ixr: rpb
blx: vnv plt uqv
ydb: nju kxy xed
jtk: out
pcy: vcs nnb
siz: xob ggb
qic: hsx
wrs: may vse
eom: gyo
rnw: ukm
srh: jbx ipz
qzv: wia nog tln lkc
kor: nfw zpz
htl: axv rcz qop
msf: you ykg tgk cjp
vyn: uwx
irn: dct qug pgs
vke: yhv uyb
xnv: oyz yhv uyb
uwx: cjp
dtw: hzv nwl peg
qeh: cmz nyd
zae: wns omw pcz
ppo: kpa
uob: ahy wei
ony: mhd
mrg: yvj ltc iag cmv
ofx: wst ybq qqa ehu
zmb: kxy nju
lqs: fuj
eai: ren
fft: yzt blx jpn xrt ysw
cmv: xnv yct
pmh: wst ehu ybq
vca: bvz zpi
zhm: pcz xry
tln: tgk you ykg
pao: nwb ues yon
uht: taw ffa tan ofg
otu: zzx rnx
sdm: out
beg: out
ren: rye pgb mbm ecy
bjr: gwt qrb
cnn: urx ojz jtq
jcm: oae nxt
vnv: uyb qlj
vzx: out
tqj: zne fdm szf
lgg: jdq fbb asj
rpb: oyg jbx ivr ipz
lgb: gxr mhd arm zee fgg
ntx: ytw
nee: afk vts ksc bqf
ksc: qbg
urx: seb
ovo: ukm
pub: dct pgs qxa
crj: pgb rye alh
haj: klx cvv sfd
oim: weh dxf zno ytw opp
npo: mhd arm fgg gxr
raa: sxv emj
rfk: fje
ktn: blx jpn xrt
lrv: ved lto hni
hwx: kpe mga
fei: cjp you ykg
lap: ldh otu
lnv: rtf bvz zpi
saj: uzy fct
skk: qtl yck jtk
cnr: vse may tqj zpb
jjk: lgg cvv sfd
rok: rfb gij
gpn: jcy
led: qzv drh
ksw: xvw gcs
cqj: uyb oyz
sti: gki huw nsb
swo: yxl xlx
rtf: swo
uyb: mqm pii eeo nvs rnk gjk tes dwz wdx tdq lmv
dki: hzv nwl sei nsg peg
rnx: out
bli: qix ixj
tlf: iag iwy ltc
huf: nps
qmy: bid cub jcy
huw: dof
nnb: mau bbf avw eqo nar
qqg: kxy xed
dyd: qeh chy
xmv: ztd llf lnv
yzt: plt uqv vnv
mqm: uso
myt: foi lap hdp
axd: esg vub wrs cnr
zyz: beg hsx hjd
ufi: fgo hsx beg
dfi: xcr
ecy: cub bid
fql: fes hdp lap
jjn: sei nsg peg
awz: gkh
cpl: wii
ous: sei nsg peg
efw: wia qww tln lkc
you: teg ndz ljf dga agc ikl zob oqw gra jbh gym zgm pye ctp ovj
cjp: ovj ctp zgm jbh gym gra ikl zob gju oqw agc dga ljf vwx bds lrv teg ndz bwj
lin: fgo
mxu: fje btx hhl wal
rwt: out
xed: eom fau blh dlw bjr apc vaz akc hmx jjk aan ebu haj yez ixr qnr poc qda
nlq: ooa jcy cub
ixj: cub jcy
lll: bey pmh inl gms mpg nkx ohv ofx fuo sha ahr nee xpe asv mcv
ybq: vkm
gci: ooa jcy
rfb: rsk
ywb: grr gni led
tya: opp
asj: yhv oyz
jpn: vnv
rqd: ymd nsb gki
qkg: tku irn
svr: lll vny xvx gaq
gqr: fft gjs ymt
chy: nyd vzu cmz
yza: uyb qlj oyz
nhd: sds gho
skd: yza cqj wnt vmk
eeo: lzk lkk
ykg: ctp ovj gym ikl gju gra fwv lrv bds vwx ljf bwj
fdm: bid
pdq: ayf fql myt irf btu
vvk: msf svn
zne: cub bid
gcs: tgk ykg
ooa: jjn xzi eoa ozq dki kor tga rtk ous mni
gjk: pcy
pgj: nim
ekb: dly qmy hwv
ive: xed nju kxy
omw: ufi
ehw: dob ctf
fvw: wei
pii: mxu zfo
ktj: fql irf btu
hmf: jcy
cgd: pcd rea qkg
xpe: ose iyx fvw uob
ztn: yvg nnb
wxi: weh dxf
ntl: ztd
oxb: mga aqd kpe ocg
cge: qjf pfe
svm: crj wlu ren hvz
nxt: uyb qlj oyz
cgq: hyr tun fei
ivr: upm jcm gkl fjv
jtq: ybb
dpn: pcd rea
qww: cjp tgk you
rxt: btt
afk: yrh wwz
nar: mfc bjj cin xyw
yck: out
svn: cjp ykg you tgk
uft: rcz ziq
upm: hcc
lzk: nkd
ufu: cub
qlj: xva nvs dpn dyd mtp cgd pdl rnk gjk otz jkd lmv atk pii ruj wdx vak sti eeo mqm jzd dwz tes tdq
irf: hdp fes
xlx: out
btu: foi
gjs: ysw xrt jpn blx yzt
apc: cae qqp
eoa: nfw
ocg: qcx uft htl gwu gaz
xva: hwx ovp lkk
klx: asj fbb bcp jdq
hhl: xyw
hwv: cub jcy ooa
ysj: hvz wlu crj
moo: qww tln nog
abt: vcs yvg nnb
jkd: nsb ymd huw
nwb: jcy cub
jlm: zrr rwt sdm izy
ofg: saj oli
zfo: dni
tgk: bwj ndz fwv teg bds lrv vwx ljf oqw gju ikl gra dga agc ovj gym jbh pye zgm
axv: xyw bjj
ils: oqh
dlw: bie qrb
hbl: cgq oli yga saj
kts: agr zhm zae
qnr: fmk rpb
fje: mfc bjj cin
nfm: whc
yxl: out
gwt: bbu
uzy: tgk cjp
ziq: mfc bjj xyw cin
tpx: out
zpz: cpl raa
may: gpn fdm nlq szf
nyd: cin
weh: kxy nju xed
lmv: pcy ztn
bjj: kgx cii mbv uzf hpv rok aso rpf eai qlq srd htg vpq cnn mvv rxt icw dfv pav yjs svm axd lqs
gkl: oae
rit: ofg ffa taw
wwz: sfu
wlu: ecy pgb rye
wul: qlj yhv
bgp: cjp
tga: jtb bpb
zzx: out
qki: iag iwy yvj
wdx: uso chy
dob: iep auh
llf: bvz
bvm: zhm whc agr
hmx: fmk
foi: rlt otu
yrh: tzi
bvz: isk
wqn: uht kjo fsk upc rit
ovj: vja xmv
lbs: uyb oyz
ljf: nni oek
bid: xyo kor ywb rtk ozq jjn
uzf: wrs blv cnr
yjs: esg
btx: bjj cin
avw: xyw
ehu: meq nwe qqg igv
jed: mfc xyw cin
aan: sfd lgg klx
fwv: xmv vja ntl
igv: xed
wal: cin xyw mfc
aqd: uft
gwu: rcz
gxr: skk
upc: hbl taw ffa tan ofg
hzv: nhd
izy: out
srd: viq
pav: izo bli sho
mbv: fuj ekb viq
emj: you
izo: vbw eor gpr ixj
vse: szf nlq fdm zne
pgb: jcy bid
jdq: yhv uyb
ayf: foi lap hdp fes
tzi: qjf
pcd: pub
yga: uzy
gpr: bid jcy cub
nim: ewr jlm crv rej
atk: oxb lzk
grr: moo qzv efw ewa drh
hzg: bhs yck
tft: btu irf myt fql
tdq: chy
uso: vzu
ymt: blx ysw
fbb: qlj uyb
zob: pdq
pss: hmc tif nwa
tnb: gbg vvk
qjf: nju
iej: nfw xcf
gkm: gni grr
mpg: kmv awz ovo rmn
dwz: pcy
blv: zpb tqj
ose: wlw ahy
ymg: xlx
sha: kmv rmn ovo rnw
eor: ooa
ldu: cub
nkg: gcs
wnt: yhv uyb
vae: you ykg tgk
pye: ved
rmn: gkh ukm bna
lqa: ggb xob
yhv: xva nvs dpn dyd mtp cgd ils pdl rnk gjk omj otz jkd atk lmv pii ruj vak sti eeo mqm jzd dwz rqd tdq
bhs: out
icw: urx
ltc: wul rhq vke
rhq: uyb
esg: zpb tqj vse
cub: rtk tga dtw jjn knm poh qqq dki iej
xyo: nkg ksw jtb vyn
nsg: psk tnb nhd
ysw: vnv
gkh: wxi oim fwq
akc: gqr rrs qoi
czy: wlu
jdr: ewr cot jlm crv
qqq: zpz
kyg: egc gjs ymt
agc: oek eds
bbf: mfc
ytw: kxy
tku: qxa dct qug
nsb: pss mjz dof
seb: yon
ggb: xed
nps: xed
tif: xyw bjj mfc
dsv: jed txn tif
nni: npo
dly: jcy cub
xcr: jlm rej crv ewr
hdp: ldh otu
ohv: vts ksc bqf
vmk: qlj yhv uyb oyz
qbg: cge huf sfu
bna: wxi tya fwq
ddi: jtk
trn: cqj
nwe: xed
ipz: upm gkl fjv
fco: tun fei uzy
rea: pub tku irn
bqf: qbg yrh
sho: gpr ixj qix vbw eor
pof: uob fvw iyx
isk: xlx vzx
dct: mfc bjj xyw cin
ntk: cnr wrs
nog: cjp ykg you tgk
rcz: bjj mfc cin
mfc: icw qlq eai vpq htg pav cnn mbv svm yjs
rlt: tpx zzx rnx
mau: bjj cin
pxj: dfi pgj way
xvw: cjp tgk you ykg
bds: bvm nfm kts
rpf: qvw wgo gij
vzu: bjj mfc
qae: yck bhs qtl
dxf: kxy nju
omj: oxb lzk hwx
pgs: mfc bjj xyw
ndz: eds oek nni
mni: peg sei nwl hzv
ewr: zrr izy
mtf: oyz yhv
yon: bid jcy cub
jbx: upm jcm gkl
gaz: axv ziq rcz
qcx: rcz qop axv
gij: yow
rnk: oqh
iwy: vke rhq
uqv: oyz uyb qlj
sfu: zmb qjf
nwa: bjj
ttm: gqr rrs kyg qoi
jtb: gcs uwx xvw
nkx: iyx
rtk: rit upc fsk kjo uht
agr: pcz omw
oqh: btx fje wal
fau: fmk rpb srh
sfd: jdq bcp asj
fjv: nxt oae
ojz: seb pao ybb
qix: bid
way: jdr
jbh: wuo
unc: kxy xed
kbp: ydb xob ggb unc
hvz: pgb mbm rye
wii: tgk you cjp
dga: kts nfm bvm
bpb: uwx
inl: wst ehu qqa
zee: wjp qae ddi
pdl: ovp hwx lzk oxb
gra: kts
crv: sdm rwt
oqw: lto
xzi: uht kjo fsk
hyr: you
xis: cqj yza lbs vmk wnt
ahy: lfd ive
plr: yrh
fgo: out
qvw: ehw ppo yow
viq: qmy
plt: oyz yhv
hmc: cin mfc
btt: qix eor vbw
pfe: nju xed
yvg: bbf eqo
tes: abt ztn pcy
fmk: ivr oyg fno ipz
mjr: iwy ltc
txn: cin mfc bjj
mhd: hzg ddi wjp skk
vaz: gyo cae qqp

90
11/main.go Normal file
View File

@@ -0,0 +1,90 @@
package main
import (
"fmt"
"strings"
"git.z1glr.de/advent-of-code-2025/pkg/aoc"
)
type Server struct {
Start, Out bool
Destinations map[string]*Server
}
func (s *Server) Walk() int {
if s.Out {
return 1
} else {
routes := 0
for _, dd := range s.Destinations {
routes += dd.Walk()
}
return routes
}
}
func ParseServerLine(s string) (*Server, string) {
stringFields := strings.Fields(s)
returnServer := Server{
Destinations: make(map[string]*Server),
}
for _, ff := range stringFields[1:] {
switch ff {
case "you":
returnServer.Start = true
case "out":
returnServer.Out = true
default:
returnServer.Destinations[ff] = nil
}
}
return &returnServer, stringFields[0][:len(stringFields[0])-1]
}
func do(test bool) (int, int) {
rows := aoc.ReadFileRows(test)
servers := make(map[string]*Server)
starts := []*Server{}
for _, rr := range rows {
thisServer, name := ParseServerLine(rr)
servers[name] = thisServer
if thisServer.Start {
starts = append(starts, thisServer)
}
}
// populate destinations
for ii := range servers {
ss := servers[ii]
for dd := range ss.Destinations {
ss.Destinations[dd] = servers[dd]
}
}
routes := 0
for _, ss := range starts[:1] {
routes += ss.Walk()
}
fmt.Println(routes)
return routes, 0
}
func main() {
if r1, r2 := do(true); r1 == 5 && r2 == 0 {
do(false)
}
}

10
11/test Normal file
View File

@@ -0,0 +1,10 @@
aaa: you hhh
you: bbb ccc
bbb: ddd eee
ccc: ddd eee fff
ddd: ggg
eee: out
fff: out
ggg: out
hhh: ccc fff iii
iii: out

View File

@@ -24,9 +24,5 @@ func ReadFileRows(test bool) []string {
rows := strings.Split(cont, "\n")
for ii, rr := range rows {
rows[ii] = strings.TrimSpace(rr)
}
return rows
}