-
-
Save apeiros/70fddaf3e4caf399feb4 to your computer and use it in GitHub Desktop.
need_help1
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
#!/usr/bin/env ruby | |
list = { | |
'name' => 'Patrick', | |
'Patrick' => 'Age', | |
'Age' => 'Addy', | |
'Addy' => '_none', | |
} | |
current = 'name' | |
collector = [] | |
begin | |
current = list[current] | |
collector << current | |
end until current == '_none' | |
collector.pop | |
p collector |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment