14 lines
255 B
PostScript
14 lines
255 B
PostScript
/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
|