public int getBestSquare(Board board, int x, int y) {
		for (int radius = 1; radius < board.w; radius++) {
			int size = 2*radius;
			if ((x+size) >= board.w || (y+size) >= board.h)
				return radius-1;
			for (int i = 0; i <= size; i++)
			{
				if (!board.cells[x+i][y+size-1])
					return radius-1;
				if (!board.cells[x+size-1][y+i])
					return radius-1;
				if (!board.cells[x+i][y+size])
					return radius-1;
				if (!board.cells[x+size][y+i])
					return radius-1;
			}
		}
		
		return 0;
	}