sztuczna_inteligencja_2023_.../turnCar.py
2023-04-22 17:46:08 +02:00

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