Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def peel(vegetable_with_layers)
- if vegetable_with_layers[0] == 'core'
- # base case: have I reached the core?
- vegetable_with_layers[0]
- else
- # not the core... remove one layer
- peel(vegetable_with_layers[0])
- end
- end
- onion = [[['core']]]
- peel(onion)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement