Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Ackermann-function/PostScript/ackermann-function-1.ps
Normal file
14
Task/Ackermann-function/PostScript/ackermann-function-1.ps
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/ackermann{
|
||||
/n exch def
|
||||
/m exch def %PostScript takes arguments in the reverse order as specified in the function definition
|
||||
m 0 eq{
|
||||
n 1 add
|
||||
}if
|
||||
m 0 gt n 0 eq and
|
||||
{
|
||||
m 1 sub 1 ackermann
|
||||
}if
|
||||
m 0 gt n 0 gt and{
|
||||
m 1 sub m n 1 sub ackermann ackermann
|
||||
}if
|
||||
}def
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/A {
|
||||
[/.m /.n] let
|
||||
{
|
||||
{.m 0 eq} {.n succ} is?
|
||||
{.m 0 gt .n 0 eq and} {.m pred 1 A} is?
|
||||
{.m 0 gt .n 0 gt and} {.m pred .m .n pred A A} is?
|
||||
} cond
|
||||
end}.
|
||||
Loading…
Add table
Add a link
Reference in a new issue