fix(solver): call random.seed() from constructor
This commit is contained in:
parent
fa75e61acf
commit
ed5f0033fa
1 changed files with 2 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue