# File src/clockwise-p1.rb, line 19 def more_clockwise(this, other) here = this.destination.place there = other.destination.place # if both are on a spoke, choose the one with the lowest number (nearer the rim) if here =~ /.c./ and there =~ /.c./ # break ties by preferring the most clockwise arc if here[-1] == there[-1] return here[0] <=> there[0] else return -1 * (here[-1] <=> there[-1]) end # If one is one a spoke and the other is on the rim, choose the one on the rim elsif here =~ /.c./ or there =~ /.c./ return -1 * (here.length <=> there.length) # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a' elsif here[0,1] == 'a' and there[0,1] == 'f' return +1 elsif here[0,1] == 'f' and there[0,1] == 'a' return -1 # Otherwise, choose the one with highest arc code else return here <=> there end end