maze-algorithms
Advanced tools
Comparing version 0.3.6 to 0.3.7
{ | ||
"name": "maze-algorithms", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"description": "Maze Algorithms provides various functions to create different mazes.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -7,3 +7,3 @@ import Graph from 'tessellatron' | ||
graph, | ||
id00 = 0, | ||
id00 = undefined, | ||
) { | ||
@@ -17,3 +17,12 @@ | ||
// instead, use enqueue, dequeue, and peek. | ||
this.queue = new Queue(id00) | ||
this.queue = new Queue() | ||
// if there is any nodes at all, choose a start node. | ||
// then, add it to the selection queue. | ||
if (this.graph.data.length > 0) { | ||
if (id00 === undefined) { | ||
id00 = Math.floor(Math.random() * this.graph.data.length) | ||
} | ||
this.queue.enqueue(id00) | ||
} | ||
} | ||
@@ -20,0 +29,0 @@ |
@@ -7,3 +7,3 @@ import Graphs from 'tessellatron' | ||
graph, | ||
id00 = 0, | ||
id00 = undefined, | ||
) { | ||
@@ -17,3 +17,12 @@ | ||
// instead, use pop, push, and peek. | ||
this.stack = new Stack(id00) | ||
this.stack = new Stack() | ||
// if there is any nodes at all, choose a start node. | ||
// then, add it to the selection stack. | ||
if (this.graph.data.length > 0) { | ||
if (id00 === undefined) { | ||
id00 = Math.floor(Math.random() * this.graph.data.length) | ||
} | ||
this.stack.push(id00) | ||
} | ||
} | ||
@@ -20,0 +29,0 @@ |
12390
341