public Location placeShip(int size, boolean retry)
			throws ArrayIndexOutOfBoundsException, InputMismatchException {

		shipSize = size;

		randomRow = (int) (Math.random() * (SIZE - 2));
		randomCol = (int) (Math.random() * (SIZE - 2));
		Random random = new Random();
		horizontal = random.nextBoolean();

		// System.out.println("RandomRow & RandomCol: " + randomRow + " "
		// + randomCol);

		if (randomRow < 0 || randomCol < 0
				|| (horizontal && randomRow + shipSize > 10)
				|| (!horizontal && randomCol + shipSize > 10))
			return placeShip(size, true);

		ship = new ComputerLocation(randomRow, randomCol, horizontal, shipSize);

		if (isValid() == false) {
			return placeShip(size, true);
		}
		setComputerBoard();

		return ship;

	}