Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,4 @@
(defun factorial (n)
(cond
((== n 0) 1)
((> n 0) (* n (factorial (- n 1))))))

View file

@ -0,0 +1,4 @@
(defun factorial
((n) (when (== n 0)) 1)
((n) (when (> n 0))
(* n (factorial (- n 1)))))

View file

@ -0,0 +1,4 @@
(defun factorial
((0) 1)
((n) (when (> n 0))
(* n (factorial (- n 1)))))

View file

@ -0,0 +1,7 @@
(defun factorial (n)
(factorial n 1))
(defun factorial
((0 acc) acc)
((n acc) (when (> n 0))
(factorial (- n 1) (* n acc))))

View file

@ -0,0 +1,12 @@
> (lists:map #'factorial/1 (lists:seq 10 20))
(3628800
39916800
479001600
6227020800
87178291200
1307674368000
20922789888000
355687428096000
6402373705728000
121645100408832000
2432902008176640000)

View file

@ -0,0 +1,16 @@
> (lists:foreach
(lambda (x)
(io:format '"~p~n" `(,(factorial x))))
(lists:seq 10 20))
3628800
39916800
479001600
6227020800
87178291200
1307674368000
20922789888000
355687428096000
6402373705728000
121645100408832000
2432902008176640000
ok