Skip to content

Instantly share code, notes, and snippets.

@kenmazaika
Last active August 29, 2015 14:27
Show Gist options
  • Save kenmazaika/4343aba68dab65185bf4 to your computer and use it in GitHub Desktop.
Save kenmazaika/4343aba68dab65185bf4 to your computer and use it in GitHub Desktop.
n = 10
while n != 0
puts "n is #{n}: IMPERITIVE"
n = n - 1
end
def recurse(n=10)
return if n == 0
puts "n is #{n}: RECURSIVE"
recurse(n - 1)
end
recurse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment