Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Last active December 16, 2015 12:19
Show Gist options
  • Save fowlmouth/5433967 to your computer and use it in GitHub Desktop.
Save fowlmouth/5433967 to your computer and use it in GitHub Desktop.
class Array
def unzip
#r = Array.new(self[0].size) {[]}
#each { |arr|
each_with_object(Array.new(self[0].size){[]}) {|arr, r|
arr.each_with_index { |x, i|
r[i] << x
}
}
#r
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment