2018 Day 23*

Had to find someone else's python solution to get an answer.
Need to pull it apart and figure out what's wrong with my solution.
This commit is contained in:
2019-11-07 15:43:14 -06:00
parent 7c9742fb73
commit 1ec6280623
6 changed files with 1198 additions and 82 deletions

18
2018/day23/coord.go Normal file
View File

@@ -0,0 +1,18 @@
package main
type Coordinate struct {
X, Y, Z int
}
var Zero = Coordinate{X: 0, Y: 0, Z: 0}
func (c Coordinate) Distance(a Coordinate) int {
return abs(c.X-a.X) + abs(c.Y-a.Y) + abs(c.Z-a.Z)
}
func abs(v int) int {
if v < 0 {
return v * -1
}
return v
}