mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-06-07 12:45:10 +02:00
!changed mathutil package to mathy, removed int/string casting from mathy
This commit is contained in:
+3
-3
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/alexchao26/advent-of-code-go/mathutil"
|
||||
"github.com/alexchao26/advent-of-code-go/mathy"
|
||||
"github.com/alexchao26/advent-of-code-go/util"
|
||||
)
|
||||
|
||||
@@ -120,7 +120,7 @@ func zeroOutHexDirections(tally [6]int) [6]int {
|
||||
for i := range tally {
|
||||
if tally[i] != 0 {
|
||||
oppositeIndex := (i + 3) % 6
|
||||
smaller := mathutil.MinInt(tally[oppositeIndex], tally[i])
|
||||
smaller := mathy.MinInt(tally[oppositeIndex], tally[i])
|
||||
tally[oppositeIndex] -= smaller
|
||||
tally[i] -= smaller
|
||||
}
|
||||
@@ -132,7 +132,7 @@ func zeroOutHexDirections(tally [6]int) [6]int {
|
||||
toLeft := (i + 5) % 6
|
||||
toRight := (i + 1) % 6
|
||||
if tally[toLeft] > 0 && tally[toRight] > 0 {
|
||||
smaller := mathutil.MinInt(tally[toLeft], tally[toRight])
|
||||
smaller := mathy.MinInt(tally[toLeft], tally[toRight])
|
||||
tally[toLeft] -= smaller
|
||||
tally[toRight] -= smaller
|
||||
tally[i] += smaller
|
||||
|
||||
Reference in New Issue
Block a user