!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
+5 -4
View File
@@ -5,7 +5,8 @@ import (
"fmt"
"strings"
"github.com/alexchao26/advent-of-code-go/mathutil"
"github.com/alexchao26/advent-of-code-go/cast"
"github.com/alexchao26/advent-of-code-go/mathy"
"github.com/alexchao26/advent-of-code-go/util"
)
@@ -67,7 +68,7 @@ func part1(input string) int {
}
}
return mathutil.ManhattanDistance(0, 0, shipX, shipY)
return mathy.ManhattanDistance(0, 0, shipX, shipY)
}
func part2(input string) int {
@@ -111,7 +112,7 @@ func part2(input string) int {
}
}
return mathutil.ManhattanDistance(0, 0, shipX, shipY)
return mathy.ManhattanDistance(0, 0, shipX, shipY)
}
type instruction struct {
@@ -126,7 +127,7 @@ func parseInput(input string) []instruction {
for _, l := range lines {
inst := instruction{
action: l[:1],
value: mathutil.StrToInt(l[1:]),
value: cast.ToInt(l[1:]),
}
ans = append(ans, inst)
}