Ackermann function: Difference between revisions
Content added Content deleted
imported>Rowsety Moid No edit summary |
|||
Line 786: | Line 786: | ||
WRITE: / lv_result. |
WRITE: / lv_result. |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Acornsoft Lisp}}== |
|||
{{trans|Common Lisp}} |
|||
<syntaxhighlight lang="lisp"> |
|||
(defun ack (m n) |
|||
(cond ((zerop m) (add1 n)) |
|||
((zerop n) (ack (sub1 m) 1)) |
|||
(t (ack (sub1 m) (ack m (sub1 n)))))) |
|||
</syntaxhighlight> |
|||
{{Out}} |
|||
<pre> |
|||
Evaluate : (ack 3 5) |
|||
Value is : 253 |
|||
</pre> |
|||
=={{header|Action!}}== |
=={{header|Action!}}== |