Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Ackermann-function/Icon/ackermann-function.icon
Normal file
25
Task/Ackermann-function/Icon/ackermann-function.icon
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
procedure acker(i, j)
|
||||
static memory
|
||||
|
||||
initial {
|
||||
memory := table()
|
||||
every memory[0 to 100] := table()
|
||||
}
|
||||
|
||||
if i = 0 then return j + 1
|
||||
|
||||
if j = 0 then /memory[i][j] := acker(i - 1, 1)
|
||||
else /memory[i][j] := acker(i - 1, acker(i, j - 1))
|
||||
|
||||
return memory[i][j]
|
||||
|
||||
end
|
||||
|
||||
procedure main()
|
||||
every m := 0 to 3 do {
|
||||
every n := 0 to 8 do {
|
||||
writes(acker(m, n) || " ")
|
||||
}
|
||||
write()
|
||||
}
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue