Skip to content

Commit

Permalink
Made the code consistent with the others.
Browse files Browse the repository at this point in the history
  • Loading branch information
hemalvarambhia committed Oct 25, 2023
1 parent d360e42 commit a9de633
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def next_coordinate_forwards(current_position:, direction:)
def next_coordinate_backwards(current_position:, direction:)
case direction
when 'N'
next_y = at_bottom_edge?(current_position) ? @y_domain.last : current_position.y - 1
next_y = at_bottom_edge?(current_position) ? @y_domain.end : current_position.y - 1
Coordinates.new(x: current_position.x, y: next_y)
when 'E'
next_x = at_left_hand_edge?(current_position) ? @x_domain.end : current_position.x - 1
Expand Down

0 comments on commit a9de633

Please sign in to comment.