!changed mathutil package to mathy, removed int/string casting from mathy

This commit is contained in:
alexchao26
2020-12-27 17:21:33 -05:00
parent 57fff6d829
commit 666518f507
114 changed files with 780 additions and 287 deletions
+3 -3
View File
@@ -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