update
This commit is contained in:
parent
1f1ad49427
commit
6f050a029e
2496 changed files with 37609 additions and 3031 deletions
|
|
@ -3,7 +3,7 @@ note
|
|||
URI: "http://rosettacode.org/wiki/Ackermann_function"
|
||||
|
||||
class
|
||||
ACKERMAN_EXAMPLE
|
||||
APPLICATION
|
||||
|
||||
create
|
||||
make
|
||||
|
|
@ -27,15 +27,14 @@ feature {NONE} -- Initialization
|
|||
|
||||
feature -- Access
|
||||
|
||||
ackerman (m: NATURAL; n: NATURAL): NATURAL
|
||||
ackerman (m, n: NATURAL): NATURAL
|
||||
do
|
||||
if m = 0 then
|
||||
Result := n + 1
|
||||
elseif m > 0 and n = 0 then
|
||||
elseif n = 0 then
|
||||
Result := ackerman (m - 1, 1)
|
||||
elseif m > 0 and n > 0 then
|
||||
else
|
||||
Result := ackerman (m - 1, ackerman (m, n - 1))
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue