Last active
November 5, 2019 14:54
-
-
Save ohmree/0b4789ca7bb60328ac6c4fff1b9c4cf9 to your computer and use it in GitHub Desktop.
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
# 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