ddf9cc8f8c
Additionaly moving into multiparameter binary operations
16 lines
316 B
Plaintext
16 lines
316 B
Plaintext
for := [ start stop iteration |
|
|
if (start > stop)
|
|
[nil]
|
|
[iteration start; for (start + 1) stop iteration]
|
|
];
|
|
|
|
factorial := [n | if (n <= 1) [1] [n * (factorial (n-1))]];
|
|
for 1 10 [i | say (factorial i)];
|
|
|
|
factorial_iterative := [n |
|
|
x := 1;
|
|
for 1 n [i|x *= i];
|
|
x
|
|
];
|
|
for 1 10 [i | say (factorial_iterative i)];
|