R: Heading.turnRight()

This commit is contained in:
Paul Hameteman 2025-10-14 22:26:15 +02:00
commit 3e71bcf1af
3 changed files with 9 additions and 7 deletions

View file

@ -7,6 +7,13 @@ enum class Heading(val symbol: Char) {
WEST('W'),
;
fun turnRight() = when (this) {
EAST -> SOUTH
SOUTH -> WEST
WEST -> NORTH
NORTH -> EAST
}
override fun toString(): String = symbol.toString()
companion object {