Don't randomize weight whilst generating a maze

This commit is contained in:
2021-09-05 21:30:31 +02:00
parent 7e44d0fb3f
commit bb7b48e6e6

View File

@ -40,8 +40,8 @@ public class MazeGenerator<V> {
stack.push(current); stack.push(current);
var neighbour = unvisited.get(random.nextInt(unvisited.size())); var neighbour = unvisited.get(random.nextInt(unvisited.size()));
graph.connectNodes(current, random.nextDouble(), neighbour); graph.connectNodes(current, 1.0, neighbour);
graph.connectNodes(neighbour, random.nextDouble(), current); graph.connectNodes(neighbour, 1.0, current);
visited.add(neighbour); visited.add(neighbour);
stack.push(neighbour); stack.push(neighbour);