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