Created
June 30, 2015 07:11
-
-
Save baweaver/0a088553f40d6f90299b to your computer and use it in GitHub Desktop.
Here we go again!
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
(___=->_,__=''{__=_[$.]+__; _[$.+=$$/$$]?___[_,__]:__})['yllis os'] | |
(___ = # So he's defining a lambda that can be self-called | |
-> _, __ = '' { # with two args, one is the string and the other is an accumulator | |
# We're taking the first character and putting it ahead of the accumulator and | |
# setting it as the next accumulator | |
# | |
# $. is 0 (normally, IRB has it as 1, it's ARGF.lineno) | |
__ = _[$.] + __ | |
# Now we're incrementing it by 1 ($$ is PID, PID / PID == 1) and seeing if | |
# it returns nil (false) which would be out of bounds | |
# | |
# If out of bounds, return our accumulator, else recurse on it | |
_[$. += $$/$$] ? ___[_, __] : __ | |
})['yllis os'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment