def serpentine_y(x, y, matrix):
    """Every other column is indexed in reverse."""
    if x % 2:
        return x, matrix.rows - 1 - y
    return x, y
def serpentine_y(x, y, matrix):
    """Every other column is indexed in reverse."""
    if x % 2:
        return x, matrix.rows - 1 - y
    return x, y
def serpentine_y ( x , y , matrix ) : if x % 2 : return x , matrix . rows - 1 - y return x , y
Every other column is indexed in reverse.
Every other column is indexed in reverse .