Skip to content

Instantly share code, notes, and snippets.

@SteveBenner
Last active December 17, 2015 21:39
Show Gist options
  • Save SteveBenner/5676579 to your computer and use it in GitHub Desktop.
Save SteveBenner/5676579 to your computer and use it in GitHub Desktop.
Recursive zip
# @param [Integer] n Number of times to call zip upon self
# @return [#zip] Self, after calling Array#zip upon self given number of times
def zipr(n = self.length)
r = self
n.times { r = r.zip }
r
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment