Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Pathfinder/src/mazealgos.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
```javascript
//make recursion maze

//function will return the wallList, and this will be assigned to the ref wallList
export function generateMaze(horizontalCount, verticalCount, solveDiagonal) {
const wallList = [];
eval(wallList);
// Removed the eval() call since it is unnecessary.

//set the walls for the maze
for (var row = 0; row < verticalCount; row++) {
if (row === 0 || row === verticalCount - 1) {
Expand Down Expand Up @@ -80,3 +82,4 @@ function rescursiveMaze(startRow, startCol, endRow, endCol, wallList, solveDiago
rescursiveMaze(startRow, wallCol + 1, endRow, endCol, wallList, solveDiagonal)
}
}
```