Skip to content

Instantly share code, notes, and snippets.

@joelgallant
Last active December 19, 2015 09:59
Show Gist options
  • Save joelgallant/5936850 to your computer and use it in GitHub Desktop.
Save joelgallant/5936850 to your computer and use it in GitHub Desktop.
Gordian concatenation recursion. I am so excited to see this working!
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