Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
class Robot
def initialize
@coordinates = [0, 0]
@fired_at = []
end
def forward(n)
@coordinates[0] += n
puts @coordinates
end
def backward(n)
@coordinates[0] -= n
puts @coordinates
end
def right(n)
@coordinates[1] += n
puts @coordinates
end
def left(n)
@coordinates[1] -= n
puts @coordinates
end
def fire
@fired_at.push(@coordinates)
puts @coordinates
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.