[REBOL] Re: The Great Computer Language Shootout
From: lmecir:mbox:vol:cz at: 5-Jan-2002 13:05
Hi all,
it looks like the Rebol stack depth is too low to compute ACK 3 8. That
is why I wrote my version that uses a block to store intermediate results.
This version is slower than a recursive version and there's no doubt that it
can be optimised.
ack2: function [m n] [b] [
b: make block! 0
until [
either zero? :m [
n: :n + 1
either empty? :b [
:true
] [
m: last :b
remove back tail :b
:false
]
] [
either zero? :n [
m: :m - 1
n: 1
] [
n: :n - 1
insert tail :b :m - 1
]
:false
]
]
:n
]
Prosperous year 2002 to all
Ladislav