private static int areaTiles(char[][] tiles, int width, int height, int x,
			int y, char tile) {
		int count = 0;
		
		if (x <= 0 || x >= width - 1) {
			if (y <= 0 || y >= height - 1) {
				count += 5;
			} else {
				count += 3;
			}
		} else if (y <= 0 || y >= height - 1) {
			count += 3;
		} else {
			for(int i = x - 1; i <= x + 1; i++) {
				for (int j = y - 1; j <= y + 1; j++) {
					if (tiles[i][j] == tile) count++;					
				}
			}
		}
		return count;
	}