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
1
Task/Y-combinator/Oforth/y-combinator-1.oforth
Normal file
1
Task/Y-combinator/Oforth/y-combinator-1.oforth
Normal file
|
|
@ -0,0 +1 @@
|
|||
: Y(f) #[ f Y f perform ] ;
|
||||
2
Task/Y-combinator/Oforth/y-combinator-2.oforth
Normal file
2
Task/Y-combinator/Oforth/y-combinator-2.oforth
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
: X(me, f) #[ me f me perform f perform ] ;
|
||||
: Y(f) #X f X ;
|
||||
11
Task/Y-combinator/Oforth/y-combinator-3.oforth
Normal file
11
Task/Y-combinator/Oforth/y-combinator-3.oforth
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
: almost-fact(n, f) n ifZero: [ 1 ] else: [ n n 1 - f perform * ] ;
|
||||
#almost-fact Y => fact
|
||||
|
||||
: almost-fib(n, f) n 1 <= ifTrue: [ n ] else: [ n 1 - f perform n 2 - f perform + ] ;
|
||||
#almost-fib Y => fib
|
||||
|
||||
: almost-Ackermann(m, n, f)
|
||||
m 0 == ifTrue: [ n 1 + return ]
|
||||
n 0 == ifTrue: [ 1 m 1 - f perform return ]
|
||||
n 1 - m f perform m 1 - f perform ;
|
||||
#almost-Ackermann Y => Ackermann
|
||||
Loading…
Add table
Add a link
Reference in a new issue