| 4 | from random import randint |
| 5 | |
| 6 | class Direction(StrEnum): |
| 7 | N = "N" |
| 8 | S = "S" |
| 9 | E = "E" |
| 10 | W = "W" |
| 11 | |
| 12 | def left(self) -> Self: |
| 13 | match self: |
| 14 | case "N": |
| 15 | return Direction.W |
| 16 | case "W": |
| 17 | return Direction.S |
| 18 | case "S": |
| 19 | return Direction.E |
| 20 | case "E": |
| 21 | return Direction.N |
| 22 | |
| 23 | def right(self) -> Self: |
| 24 | match self: |
| 25 | case "N": |
| 26 | return Direction.E |
| 27 | case "E": |
| 28 | return Direction.S |
| 29 | case "S": |
| 30 | return Direction.W |
| 31 | case "W": |
| 32 | return Direction.N |
| 33 | |
| 34 | @dataclass |
| 35 | class Point: |