Created
September 22, 2018 09:26
-
-
Save paractmol/61cd0edf6451f32f840af5de64004e06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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