Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def self.parse(string)
commands = string.split("\n")
rover = new(*commands.delete_at(0).split(' '))
output = ''
commands.each_slice(2) do |deploy_coords, instructions|
rover.deploy(*deploy_coords.split(' '))
output << rover.process(instructions) + "\n"
end
output
 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.