Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
4
Task/Factorial/Soda/factorial-1.soda
Normal file
4
Task/Factorial/Soda/factorial-1.soda
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
factorial (n : Int) : Int =
|
||||
if n < 2
|
||||
then 1
|
||||
else n * factorial (n - 1)
|
||||
8
Task/Factorial/Soda/factorial-2.soda
Normal file
8
Task/Factorial/Soda/factorial-2.soda
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
@tailrec
|
||||
_tailrec_fact (n : Int) (accum : Int) : Int =
|
||||
if n < 2
|
||||
then accum
|
||||
else _tailrec_fact (n - 1) (n * accum)
|
||||
|
||||
factorial (n : Int) : Int =
|
||||
_tailrec_fact (n) (1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue