fix(solver): call random.seed() from constructor

This commit is contained in:
Dan Anglin 2024-02-17 04:01:56 +00:00
parent fa75e61acf
commit ed5f0033fa
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638

View file

@ -21,6 +21,8 @@ class Solver:
MazeDirection.RIGHT: CellWallLabels.LEFT,
}
random.seed()
def solve(
self,
solve_method: Callable[[MazePosition, MazePosition, bool], bool],
@ -60,8 +62,6 @@ class Solver:
visitor=self._solver,
)
if enable_random_direction:
random.seed()
while True:
possible_directions: List[MazeDirection] = []
@ -117,9 +117,6 @@ class Solver:
visitor=self._solver,
)
if enable_random_direction:
random.seed()
while True:
possible_directions = []
for direction in MazeDirection: