mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-10 14:50:46 +00:00
30 lines
382 B
Go
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)
|
||
|
}
|