def __checkValidShipPlacement__(length, coords, board):
    """
    Checks if a requested ship placement is valid

    Parameters
    -------------------

    length: int
        Length of ship
    coords: tuple (int, int, str)
        (startCoordY, startCoordX, direction('u', 'd', 'l', 'r'))
    board: 10x10 numpy array
        Filled with ' ', 'O', 'X'
    """
    if coords[2] == 'l':
        if coords[1] < length - 1:
            return False
        for i in range(length):
            if board[coords[0]][coords[1] - i] != ' ':
                return False
    elif coords[2] == 'r':
        if coords[1] > 10 - length:
            return False
        for i in range(length):
            if board[coords[0]][coords[1] + i] != ' ':
                return False
    elif coords[2] == 'u':
        if coords[0] < length - 1:
            return False
        for i in range(length):
            if board[coords[0] - i][coords[1]] != ' ':
                return False
    elif coords[2] == 'd':
        if coords[0] > 10 - length:
            return False
        for i in range(length):
            if board[coords[0] + i][coords[1]] != ' ':
                return False
    return True
