Skip to content

Instantly share code, notes, and snippets.

@ohmree
Last active November 5, 2019 14:54
Show Gist options
  • Save ohmree/0b4789ca7bb60328ac6c4fff1b9c4cf9 to your computer and use it in GitHub Desktop.
Save ohmree/0b4789ca7bb60328ac6c4fff1b9c4cf9 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
def recurse(*more)
public_send(caller[0][/`.*'/][1..-2], *more)
end
def doit_helper(n, acc)
puts '*' * acc
recurse(n, acc+1) unless acc >= n
end
def doit(n)
doit_helper(n, 1)
end
doit(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment