Skip to content

Instantly share code, notes, and snippets.

@akouryy
Created July 23, 2015 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akouryy/1496562f17a9013e4881 to your computer and use it in GitHub Desktop.
Save akouryy/1496562f17a9013e4881 to your computer and use it in GitHub Desktop.
ゆ{2,}式
def yu; gets.to_i end
class Integer
def yu sym = nil
if sym
yu &sym
elsif block_given?
times.map{|i| yield gets.chomp}
else
times.map{gets.chomp}
end
end
end
class String
def yu; split.map &:to_i end
end
class Array
alias yu transpose
end
p yu.yu(:yu).yu
# p gets.to_i.times.map{gets.split.map &:to_i}.transpose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment