def flip_y_perspective(row:int, current_player:int, is_vwall:bool=False)->int:
    """Flip row coordinates for player 1 so that -- no matter who the 'current player' is -- the enemy's gate is down.

    Note that flip_y_perspective is its own inverse, so flip_y_perspective(flip_y_perspective(r, c, v), c, v) == r
    """
    # Since vertical walls are labeled by their 'top' coordinate, we need a slightly different rule. This is because
    # what was the 'bottom' coordinate at (row+1) will become the top coordinate.
    if current_player == 0:
        return row
    elif is_vwall:
        # Essentially 8-(row+1) to flip 'bottom' of wall to 'top'
        return 7-row
    else:
        return 8-row