function redrawMaze(range) {
      const w = sW/cols, h = sH/rows;
      g.setColor(0.76, 0.60, 0.42);
      for(let row = range.top; row<=range.bottom; row++) {
        for(let col = range.left; col<=range.right; col++) {
          const walls = rooms[row*cols+col], x = col*w, y = row*h;
          if (row===range.top && walls&TOP) g.drawLine(x, y, x+w, y);
          if (col===range.left && walls&LEFT) g.drawLine(x, y, x, y+h);
          if (walls&BOTTOM) g.drawLine(x, y+h, x+w, y+h);
          if (walls&RIGHT) g.drawLine(x+w, y, x+w, y+h);
        }
      }
      g.setColor(0.29, 0.23, 0.17).drawRect(0, 0, sW-1, sH-1);
    }
/**
     * Redraw a part of the maze (after we erased the ball image)
     * @param range Draw rooms in this range {top,left,bottom,right}
     */
Redraw a part of the maze (after we erased the ball image)
@param range Draw rooms in this range {top,left,bottom,right}
Redraw a part of the maze ( after we erased the ball image ) @param range Draw rooms in this range { top left bottom right }
function redrawMaze(range) {
      const w = sW/cols, h = sH/rows;
      g.setColor(0.76, 0.60, 0.42);
      for(let row = range.top; row<=range.bottom; row++) {
        for(let col = range.left; col<=range.right; col++) {
          const walls = rooms[row*cols+col], x = col*w, y = row*h;
          if (row===range.top && walls&TOP) g.drawLine(x, y, x+w, y);
          if (col===range.left && walls&LEFT) g.drawLine(x, y, x, y+h);
          if (walls&BOTTOM) g.drawLine(x, y+h, x+w, y+h);
          if (walls&RIGHT) g.drawLine(x+w, y, x+w, y+h);
        }
      }
      g.setColor(0.29, 0.23, 0.17).drawRect(0, 0, sW-1, sH-1);
    }
function redrawMaze ( range ) { const w = sW / cols , h = sH / rows ; g . setColor ( 0.76 , 0.60 , 0.42 ) ; for ( let row = range . top ; row <= range . bottom ; row ++ ) { for ( let col = range . left ; col <= range . right ; col ++ ) { const walls = rooms [ row * cols + col ] , x = col * w , y = row * h ; if ( row === range . top && walls & TOP ) g . drawLine ( x , y , x + w , y ) ; if ( col === range . left && walls & LEFT ) g . drawLine ( x , y , x , y + h ) ; if ( walls & BOTTOM ) g . drawLine ( x , y + h , x + w , y + h ) ; if ( walls & RIGHT ) g . drawLine ( x + w , y , x + w , y + h ) ; } } g . setColor ( 0.29 , 0.23 , 0.17 ) . drawRect ( 0 , 0 , sW - 1 , sH - 1 ) ; }
Redraw a part of the maze (after we erased the ball image)
 @param range Draw rooms in this range {top,left,bottom,right}
Redraw a part of the maze ( after we erased the ball image ) @param range Draw rooms in this range { top left bottom right }