aoc2024/day-11/internal/one/result.go
onyx-and-iris 2dc1d494af add result struct to package one
remove unnecessary assignments in util.splitNumber
2024-12-12 02:53:33 +00:00

30 lines
382 B
Go

package one
import "fmt"
const (
flip = iota
split
multiply
)
type result struct {
kind int
left int
right int
}
func (r result) String() string {
var kindStr string
switch r.kind {
case flip:
kindStr = "flip"
case split:
kindStr = "split"
case multiply:
kindStr = "multiply"
}
return fmt.Sprintf("kind: %s left: %d right: %d", kindStr, r.left, r.right)
}