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
19
Task/Catamorphism/Nim/catamorphism.nim
Normal file
19
Task/Catamorphism/Nim/catamorphism.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import sequtils
|
||||
|
||||
block:
|
||||
let
|
||||
numbers = @[5, 9, 11]
|
||||
addition = foldl(numbers, a + b)
|
||||
substraction = foldl(numbers, a - b)
|
||||
multiplication = foldl(numbers, a * b)
|
||||
words = @["nim", "rod", "is", "cool"]
|
||||
concatenation = foldl(words, a & b)
|
||||
|
||||
block:
|
||||
let
|
||||
numbers = @[5, 9, 11]
|
||||
addition = foldr(numbers, a + b)
|
||||
substraction = foldr(numbers, a - b)
|
||||
multiplication = foldr(numbers, a * b)
|
||||
words = @["nim", "rod", "is", "cool"]
|
||||
concatenation = foldr(words, a & b)
|
||||
Loading…
Add table
Add a link
Reference in a new issue