kurz/tests/recursion.qbl

17 lines
217 B
Plaintext
Raw Normal View History

2022-12-18 04:05:50 +01:00
//valid,10946
//:END:
function int int int int => int fibonacci
2022-12-14 11:46:47 +01:00
{
dup 0 == req req req req
if
2022-12-14 11:46:47 +01:00
{
req deq deq deq
2022-12-14 11:46:47 +01:00
}
else
{
dup + req 1 req swp - req req req fibonacci
2022-12-14 11:46:47 +01:00
}
}
2022-12-31 16:09:55 +01:00
20 0 1 0 fibonacci intToStr println