Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -2,23 +2,21 @@
// --- Ackermann function ---
#symbol ackermann = &&:m:n
#symbol ackermann = (:m:n)
[
m =>
0 ? [ n + 1 ]
> 0 ? [
n => 0 ? [ $self:(m - 1):1 ]
> 0 ? [ $self:(m - 1):($self:m:(n-1)) ]
n => 0 ? [ ackermann:(m - 1):1 ]
> 0 ? [ ackermann:(m - 1):(ackermann:m:(n-1)) ]
]
].
#symbol program =
[
#var n := ackermann:3:5.
control from:0 &to:3 &do: &&:i
control from:0 &to:3 &do: i
[
control from:0 &to:5 &do: &&:j
control from:0 &to:5 &do: j
[
console << "A(" << i << "," << j << ")=" << (ackermann:i:j).