package blitz.math import blitz.unreachable /** only 6 directions -> only needs 3 bits */ @JvmInline value class Direction( val idx: U3 ) { companion object { val UP = Direction(U3(0u)) val DOWN = Direction(U3(1u)) val NORTH = Direction(U3(2u)) val EAST = Direction(U3(3u)) val SOUTH = Direction(U3(4u)) val WEST = Direction(U3(5u)) } override fun toString() = when (this) { UP -> "Up" DOWN -> "Down" NORTH -> "North" EAST -> "East" SOUTH -> "South" WEST -> "West" else -> unreachable() } }