@@ -77,10 +77,10 @@ const stepThroughCell = (row, column) => {
7777
7878 // Assemble randomly-ordered list of neighbors
7979 const neighbors = shuffle ( [
80- // [row - 1, column, 'up'],
80+ [ row - 1 , column , 'up' ] ,
8181 [ row , column + 1 , 'right' ] ,
82- // [row + 1, column, 'down'],
83- // [row, column - 1, 'left'],
82+ [ row + 1 , column , 'down' ] ,
83+ [ row , column - 1 , 'left' ] ,
8484 ] )
8585 console . log ( neighbors )
8686
@@ -103,12 +103,17 @@ const stepThroughCell = (row, column) => {
103103 verticals [ row ] [ column - 1 ] = true
104104 } else if ( direction === 'right' ) {
105105 verticals [ row ] [ column ] = true
106+ } else if ( direction === 'up' ) {
107+ horizontals [ row - 1 ] [ column ] = true
108+ } else if ( direction === 'down' ) {
109+ horizontals [ row ] [ column ] = true
106110 }
107111 }
108112 // Visit that next cell
109113}
110114
111- // stepThroughCell(startRow, startColumn)
112- stepThroughCell ( 1 , 1 )
115+ stepThroughCell ( startRow , startColumn )
116+ // stepThroughCell(1, 1)
113117// console.log(grid)
114- console . log ( verticals ) ;
118+ // console.log(verticals);
119+ // console.log(horizontals);
0 commit comments