Commit 71ef614

mo k <mo@mokhan.ca>
2012-11-05 04:52:35
invert if expression.
1 parent 7cb159f
Changed files (2)
lib/turn_left.rb
@@ -3,9 +3,7 @@ class TurnLeft
     @rover = rover
   end
   def run(instruction)
-    if matches(instruction)
-      @rover.rotate(-90) 
-    end
+    @rover.rotate(-90) if matches(instruction)
   end
   def matches(item)
     'L' == item
lib/turn_right.rb
@@ -3,9 +3,7 @@ class TurnRight
     @rover = rover
   end
   def run(instruction)
-    if matches(instruction)
-      @rover.rotate(90) 
-    end
+    @rover.rotate(90) if matches(instruction)
   end
   def matches(item)
     'R' == item