Last active
May 18, 2016 22:54
-
-
Save agnaite/6ae18f482af9bf5e93d61f1cb60938a4 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 decode(text) | |
decoded = '' | |
text.each_char do |s| | |
if (s =~ /[0-9]/) == 0 | |
text = text[s.to_i+1..-1] | |
decoded << text[0] | |
text = text[1..-1] | |
end | |
end | |
puts "DECODED: "+decoded | |
end | |
decode("0h2abe1zy") | |
decode("3yztl1aa0b4dglja2wxs") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment