From 7cb5840ea74b5a8b34026576af2788552e937460 Mon Sep 17 00:00:00 2001 From: 3013050 <3013050@stud.hs-mannheim.de> Date: Thu, 14 Nov 2024 22:17:05 +0100 Subject: [PATCH] c --- main.roc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.roc b/main.roc index b264780..793071a 100644 --- a/main.roc +++ b/main.roc @@ -10,6 +10,13 @@ addAndStringify = \num1, num2 -> else Num.toStr sum +calcFac = \number -> +if number == 0 then + 1 +else + (number * (calcFac (number - 1))) + main = Stdout.line! "I'm a Roc application!" Stdout.line! (addAndStringify 2 3) + Stdout.line! (Num.toStr (calcFac 10))