From 1ecb4a0a4bbc8d93fdb4e00269471ed878a801d5 Mon Sep 17 00:00:00 2001 From: CheezItMan Date: Thu, 8 Aug 2019 14:19:02 -0700 Subject: [PATCH] function method added --- function.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 function.rb diff --git a/function.rb b/function.rb new file mode 100644 index 0000000..3b1d79f --- /dev/null +++ b/function.rb @@ -0,0 +1,9 @@ + +def function(n) + if n == 0 + 1 + else + n * function(n-1) + end +end +