1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
void DBLOB(char grid[][MAXCOL], int r, int c)
{
if(grid[r][c]=' ') return;
if(grid[r][c]!=' ')DBLOB(grid,r,c);
if(grid[r][c+1] != ' ') DBLOB(grid, r, c+1);
if(grid[r-1][c+1] != ' ') DBLOB(grid, r-1, c+1);
if(grid[r-1][c] != ' ') DBLOB(grid, r-1, c);
if(grid[r-1][c-1] != ' ') DBLOB(grid, r-1, c-1);
if(grid[r][c-1] != ' ') DBLOB(grid, r, c-1);
if(grid[r+1][c-1] != ' ') DBLOB(grid, r+1, c-1);
if(grid[r+1][c] != ' ') DBLOB(grid, r+1, c);
if(grid[r+1][c+1] != ' ') DBLOB(grid, r+1, c+1);
}
|