Skip to content

Commit

Permalink
* Refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
ledestin committed Apr 3, 2014
1 parent 641c22c commit 3c965ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions robot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def right
end

def place x, y, direction
x, y, direction = Integer(x), Integer(y), Direction(direction)
return unless @@table.contain? x, y
new_coords = State.new(x, y, direction)
return unless @@table.contain? new_coords.x, new_coords.y

@coords = State.new(x, y, direction)
@coords = new_coords
rescue ArgumentError
end

Expand Down

0 comments on commit 3c965ed

Please sign in to comment.