Skip to content

Instantly share code, notes, and snippets.

@jonelf
Last active August 29, 2015 14:19
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 jonelf/4d04524e5f38c05696cb to your computer and use it in GitHub Desktop.
Save jonelf/4d04524e5f38c05696cb to your computer and use it in GitHub Desktop.
Anders terapispråk som en Ruby DSL.
class Numeric
def ≫(n)
n.replace self.to_s
end
end
class String
def ≫(s)
s.replace self
end
def +(s)
(s.to_i + self.to_i).to_s
end
def ⧺
self.replace (self.to_i+1).to_s
end
def <(n)
self.to_i < n
end
def ⟷(s)
t=self.clone
self.replace s
s.replace t
end
end
class TrueClass
def ≫(s)
s.replace "Go on with the madness!"
end
end
class FalseClass
def ≫(s)
s.replace ""
end
end
def ≪(s)
$stdout << s
end
a="";b="";c="";x="";j؟=""
1.≫ a;≪ a;1.≫ b;≪ b;0.≫ x
loop do
(a+b).≫ c;≪ c;x.⧺;a.⟷ b;b.⟷ c;(x<18).≫ j؟
break if j؟.empty?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment