Last active
December 19, 2015 09:59
-
-
Save joelgallant/5936850 to your computer and use it in GitHub Desktop.
Gordian concatenation recursion. I am so excited to see this working!
This file contains 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
def concat(x, i) | |
def _concat(j, w, e) | |
if(e > 0) | |
return _concat(j + w, w, e - 1) | |
else | |
return j | |
end | |
end | |
return _concat("",x,i) | |
end | |
print(concat("Hello World", 3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment