Skip to content

Commit

Permalink
Implement new move_right functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
ColumODonovann committed Nov 10, 2023
1 parent d765e0f commit 15c2fea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/mars_rover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def move_left
def move_right
case point.direction
when 'E'
@point = @point.new_move_y(-1)
@point = Point.new(@point.x, @point.y, 'S')
when 'S'
@point = @point.new_move_x(-1)
@point = Point.new(@point.x, @point.y, 'W')
when 'W'
@point = @point.new_move_y(1)
@point = Point.new(@point.x, @point.y, 'N')
when 'N'
@point = @point.new_move_x(1)
@point = Point.new(@point.x, @point.y, 'E')
end
end
end
Expand Down
4 changes: 0 additions & 4 deletions spec/mars_rovers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
end

it 'moves right when facing North' do
pending("TODO")
mars_rover = MarsRover.new(Point.new(0,0, 'N'))

mars_rover.execute_commands(%w[r])
Expand All @@ -105,7 +104,6 @@
end

it 'moves right when facing South' do
pending("TODO")
mars_rover = MarsRover.new(Point.new(0,0, 'S'))

mars_rover.execute_commands(%w[r])
Expand All @@ -114,7 +112,6 @@
end

it 'moves right when facing East' do
pending("TODO")
mars_rover = MarsRover.new(Point.new(0,0, 'E'))

mars_rover.execute_commands(%w[r])
Expand All @@ -123,7 +120,6 @@
end

it 'moves right when facing West' do
pending("TODO")
mars_rover = MarsRover.new(Point.new(0,0, 'W'))

mars_rover.execute_commands(%w[r])
Expand Down

0 comments on commit 15c2fea

Please sign in to comment.