Solutions for day 10.

This commit is contained in:
Anna Rose Wiggins 2018-12-12 15:06:32 -05:00
parent e47b6c4a45
commit 28998c5d14
No known key found for this signature in database
GPG key ID: 8D9ACA841015C59A
4 changed files with 67 additions and 18 deletions

31
2018/day10-2.go Normal file
View file

@ -0,0 +1,31 @@
package main
import (
"fmt"
"internal/day10"
"internal/util"
)
func main() {
data := util.ReadInput()
points := day10.ParseInput(data)
lowest := day10.CalculateRange(points)
i := 0
for {
for _, point := range points {
point.Move()
}
newRange := day10.CalculateRange(points)
if newRange < lowest {
lowest = newRange
} else {
fmt.Println(i)
return
}
i++
}
}