def get_adjacents(row, col, max_row, max_col):
    """
    Obtains the directions of the adjacent spaces
    """
    result = []
    up_row = row - 1
    left_col = col - 1
    down_row = row + 1
    right_col = col + 1
    if up_row >= 0:
        result.append((up_row, col))
    if left_col >= 0:
        result.append((row, left_col))
    if down_row < max_row:
        result.append((down_row, col))
    if right_col < max_col:
        result.append((row, right_col))
    return result