def serpentine_x(x, y, matrix):
    """Every other row is indexed in reverse."""
    if y % 2:
        return matrix.columns - 1 - x, y
    return x, y
def serpentine_x(x, y, matrix):
    
    if y % 2:
        return matrix.columns - 1 - x, y
    return x, y
def serpentine_x ( x , y , matrix ) : if y % 2 : return matrix . columns - 1 - x , y return x , y
Every other row is indexed in reverse.
Every other row is indexed in reverse .