Last active
August 29, 2015 14:19
-
-
Save jonelf/4d04524e5f38c05696cb to your computer and use it in GitHub Desktop.
Anders terapispråk som en Ruby DSL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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