Just being pedantic here, but I believe this could be written a bit simpler as:

    center[0] -= 180 if @west > @east