Skip to content

Commit

Permalink
Refactor: Made the calculation more explicit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hemalvarambhia committed Oct 30, 2023
1 parent 177ae68 commit f697b31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mars_rover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def execute(commands)
when 'f'
new_location = forwards(location)
if @map.located_at_north_pole? new_location.coordinates
Location.new(coordinates: Coordinates.new(x: 18, y: 8), direction: 'S')
Location.new(coordinates: Coordinates.new(x: 0 + 18, y: 8), direction: 'S')
else
new_location
end
Expand Down

0 comments on commit f697b31

Please sign in to comment.