11import { directions } from '../Directions' ;
22import { _FindCellVisitState , _FindCellTypeState , _FindCell , _BoardReset , _GetNeighbors , _SetWalls , _GetNeighborsCell , _BoardResetWalled } from '../Tools' ;
33import exit from 'exit' ;
4- import { PATH_TYPE , DEFAULT_TYPE , FLOOR_TYPE , WALL_TYPE , START_TYPE , GOAL_TYPE } from '../../../../Utility/Colors' ;
5- import { PriorityQueue } from '../../../../Utility/PriorityQueue.js' ;
4+ import { PATH_TYPE , DEFAULT_TYPE , FLOOR_TYPE , WALL_TYPE , START_TYPE , GOAL_TYPE } from '../../../../Utility/Colors' ;
5+ import { PriorityQueue } from '../../../../Utility/PriorityQueue.js' ;
66
77
88
@@ -19,15 +19,16 @@ export function RecursiveBacktrackCreation(board, start, end) {
1919 console . log ( 'End: ' + endCell . id + ' (' + endCell . x + ' | ' + endCell . y + ')' ) ;
2020
2121 startCell . visited = true ;
22- carvePath ( board , startCell , false ) ;
22+ carvePath ( board , startCell ) ;
2323
2424 // _SetWalls(board);
2525
2626
2727}
2828
2929
30- function carvePath ( board , cell , found ) {
30+ function carvePath ( board , cell ) {
31+ let found = false ;
3132 const neighbors = _GetNeighborsCell ( board , cell ) ;
3233 if ( neighbors . length === 0 ) {
3334 console . log ( 'No neighbors found for cell: ' + cell . id + ' (' + cell . x + ' | ' + cell . y + ')' ) ;
@@ -43,7 +44,7 @@ function carvePath(board, cell, found) {
4344 }
4445 neighbor . visited = true ;
4546 neighbor . type = FLOOR_TYPE ;
46- found = carvePath ( board , neighbor , found ) ;
47+ found = carvePath ( board , neighbor ) ;
4748 if ( found ) {
4849 return found ;
4950 }
0 commit comments