19 lines
756 B
Python
19 lines
756 B
Python
|
from agentOrientation import AgentOrientation
|
||
|
|
||
|
def turn_left_orientation(orientation: AgentOrientation) -> AgentOrientation:
|
||
|
if orientation == AgentOrientation.DOWN:
|
||
|
return AgentOrientation.RIGHT
|
||
|
if orientation == AgentOrientation.LEFT:
|
||
|
return AgentOrientation.DOWN
|
||
|
if orientation == AgentOrientation.UP:
|
||
|
return AgentOrientation.LEFT
|
||
|
return AgentOrientation.UP
|
||
|
|
||
|
def turn_right_orientation(orientation: AgentOrientation) -> AgentOrientation:
|
||
|
if orientation == AgentOrientation.DOWN:
|
||
|
return AgentOrientation.LEFT
|
||
|
if orientation == AgentOrientation.LEFT:
|
||
|
return AgentOrientation.UP
|
||
|
if orientation == AgentOrientation.UP:
|
||
|
return AgentOrientation.RIGHT
|
||
|
return AgentOrientation.DOWN
|