mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-10 14:50:46 +00:00
17 lines
195 B
Go
17 lines
195 B
Go
|
package one
|
||
|
|
||
|
import "slices"
|
||
|
|
||
|
type direction int
|
||
|
|
||
|
const (
|
||
|
N direction = iota
|
||
|
E
|
||
|
S
|
||
|
W
|
||
|
)
|
||
|
|
||
|
func directions(dir rune) direction {
|
||
|
return direction(slices.Index([]rune{'^', '>', 'v', '<'}, dir))
|
||
|
}
|