Skip to content

Instantly share code, notes, and snippets.

@ueno1969
Created November 23, 2011 09:26
Show Gist options
  • Save ueno1969/1388266 to your computer and use it in GitHub Desktop.
Save ueno1969/1388266 to your computer and use it in GitHub Desktop.
たっぷるたっぷるゴルフ
def a(p,n)
(1..n).map{|m|"#{p}#{m}"}*","
end
puts ["package object richTuple{",(2..21).map{|n|[" implicit def toRichTuple#{n}[#{t=a('A',n)}](t:(#{t}))= new{
def :::[B](b:B) = (b,#{t=a('t._',n)})",(2..22-n).map{|m|" def :::[#{b=a('B',m)}](p:(#{b})) = (#{a('p._', m)},#{t})"}, " }"]}.flatten, "}"]*($/*2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment