Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def process(commands)
commands.each_char do |character|
case character
when 'L' then turn_left
when 'R' then turn_right
when 'M' then move_forward
end
end
[@x, @y, @face].join(' ')
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.