Skip to content

Commit a48457c

Browse files
committed
Fix bug in modulus calculation for checking opposite direction
1 parent e20a8b4 commit a48457c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from enum import Enum
2-
from collections import namedtuple
2+
from collections import namedtuple
33

44
class Direction(Enum):
55
NORTH = 0
@@ -8,6 +8,6 @@ class Direction(Enum):
88
WEST = 3
99

1010
def is_opposite(self, other):
11-
return self.value + other.value % 2 == 0
11+
return (self.value + other.value) % 2 == 0
1212

1313
Point = namedtuple('Point', 'x, y')

0 commit comments

Comments
 (0)