(point, to)
| 136 | return closest_direction |
| 137 | |
| 138 | def get_direction(point, to): |
| 139 | if isinstance(to, str): |
| 140 | if to in ["up", "down", "left", "right"]: |
| 141 | return to |
| 142 | else: |
| 143 | return "no direction" |
| 144 | elif isinstance(to, list): |
| 145 | try: |
| 146 | point1 = {"x": point[0], "y": point[1]} |
| 147 | point2 = {"x": to[0], "y": to[1]} |
| 148 | return _get_direction(point1, point2) |
| 149 | except Exception as e: |
| 150 | return "no direction" |
| 151 | |
| 152 | class ActionEvaluator(object): |
| 153 |
no test coverage detected