Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
13
Task/Matrix-transposition/LFE/matrix-transposition-1.lfe
Normal file
13
Task/Matrix-transposition/LFE/matrix-transposition-1.lfe
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(defun transpose (matrix)
|
||||
(transpose matrix '()))
|
||||
|
||||
(defun transpose (matrix acc)
|
||||
(cond
|
||||
((lists:any
|
||||
(lambda (x) (== x '()))
|
||||
matrix)
|
||||
acc)
|
||||
('true
|
||||
(let ((heads (lists:map #'car/1 matrix))
|
||||
(tails (lists:map #'cdr/1 matrix)))
|
||||
(transpose tails (++ acc `(,heads)))))))
|
||||
8
Task/Matrix-transposition/LFE/matrix-transposition-2.lfe
Normal file
8
Task/Matrix-transposition/LFE/matrix-transposition-2.lfe
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
> (transpose '((1 2 3)
|
||||
(4 5 6)
|
||||
(7 8 9)
|
||||
(10 11 12)
|
||||
(13 14 15)
|
||||
(16 17 18)))
|
||||
((1 4 7 10 13 16) (2 5 8 11 14 17) (3 6 9 12 15 18))
|
||||
>
|
||||
Loading…
Add table
Add a link
Reference in a new issue