R: Heading turnLeft()
This commit is contained in:
parent
3e71bcf1af
commit
a56304bc77
3 changed files with 9 additions and 7 deletions
|
|
@ -34,12 +34,7 @@ class Rover {
|
|||
}
|
||||
|
||||
private fun turnLeft() {
|
||||
when (state.heading) {
|
||||
Heading.EAST -> state.heading = Heading.NORTH
|
||||
Heading.NORTH -> state.heading = Heading.WEST
|
||||
Heading.WEST -> state.heading = Heading.SOUTH
|
||||
Heading.SOUTH -> state.heading = Heading.EAST
|
||||
}
|
||||
state.heading = state.heading.turnLeft()
|
||||
}
|
||||
|
||||
val position: String
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue