mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-15 15:10:49 +00:00
initialize lowest to maxint
This commit is contained in:
parent
60ef7a0557
commit
9fd4f8131a
@ -1,6 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"math"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -31,15 +33,12 @@ func next(i int, datapoint int) int {
|
|||||||
|
|
||||||
// one returns the lowest location
|
// one returns the lowest location
|
||||||
func one(lines []string) (int, error) {
|
func one(lines []string) (int, error) {
|
||||||
lowest := 0
|
lowest := math.MaxInt
|
||||||
parseLines(lines)
|
parseLines(lines)
|
||||||
|
|
||||||
for _, seed := range seeds {
|
for _, seed := range seeds {
|
||||||
location := next(0, seed)
|
location := next(0, seed)
|
||||||
log.Info(location)
|
log.Info(location)
|
||||||
if lowest == 0 {
|
|
||||||
lowest = location
|
|
||||||
}
|
|
||||||
if location < lowest {
|
if location < lowest {
|
||||||
lowest = location
|
lowest = location
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user