(self)
return MazeWall(start, end)
Finds the largest piece of rectangular wall at the current location.

    This function assumes that `self._next_start` is already at the top-left
    corner of the next piece of wall.

    Returns:
      A `MazeWall` named tuple representing the next piece of wall created.
Finds the largest piece of rectangular wall at the current location.
Finds the largest piece of rectangular wall at the current location .
def _find_next_wall(self):
    """Finds the largest piece of rectangular wall at the current location.

    This function assumes that `self._next_start` is already at the top-left
    corner of the next piece of wall.

    Returns:
      A `MazeWall` named tuple representing the next piece of wall created.
    """
    start = self._next_start
    x = self._maze_size.x
    end_x_for_rows = []
    total_cells = []

    for y in range(start.y, self._maze_size.y):
      x = self._scan_row(y, start.x, x)
      if x > start.x:
        if self._make_odd_sized_walls and (x - start.x) % 2 == 0:
          x -= 1
        end_x_for_rows.append(x)
        total_cells.append((x - start.x) * (y - start.y + 1))
        y += 1
      else:
        break

    if not self._make_odd_sized_walls:
      end_y_offset = total_cells.index(max(total_cells))
    else:
      end_y_offset = 2 * total_cells[::2].index(max(total_cells[::2]))
    end = GridCoordinates(start.y + end_y_offset + 1,
                          end_x_for_rows[end_y_offset])
    self._covered[start.y:end.y, start.x:end.x] = True
    self._next_start = GridCoordinates(start.y, end.x)
    return MazeWall(start, end)
def _find_next_wall ( self ) : start = self . _next_start x = self . _maze_size . x end_x_for_rows = [ ] total_cells = [ ] for y in range ( start . y , self . _maze_size . y ) : x = self . _scan_row ( y , start . x , x ) if x > start . x : if self . _make_odd_sized_walls and ( x - start . x ) % 2 == 0 : x -= 1 end_x_for_rows . append ( x ) total_cells . append ( ( x - start . x ) * ( y - start . y + 1 ) ) y += 1 else : break if not self . _make_odd_sized_walls : end_y_offset = total_cells . index ( max ( total_cells ) ) else : end_y_offset = 2 * total_cells [ : : 2 ] . index ( max ( total_cells [ : : 2 ] ) ) end = GridCoordinates ( start . y + end_y_offset + 1 , end_x_for_rows [ end_y_offset ] ) self . _covered [ start . y : end . y , start . x : end . x ] = True self . _next_start = GridCoordinates ( start . y , end . x ) return MazeWall ( start , end )