Anonymous user
Anonymous recursion: Difference between revisions
m
→{{header|Elena}}
(Added Chipmunk Basic) |
imported>Arakov |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 480:
55
</pre>
==={{header|IS-BASIC}}===▼
<syntaxhighlight lang="is-basic">100 PROGRAM "Fibonacc.bas"▼
110 FOR I=0 TO 10▼
120 PRINT FIB(I);▼
130 NEXT ▼
140 DEF FIB(K)▼
150 SELECT CASE K▼
160 CASE IS<0▼
170 PRINT "Negative parameter to Fibonacci.":STOP ▼
180 CASE 0,1▼
=={{header|Bracmat}}==
Line 1,033 ⟶ 1,049:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import extensions;
fib(n)
{
if (n
{
^ this self(n
{
^
▲ }(n)
}
public program()
{
}</syntaxhighlight>
{{out}}
Line 1,636 ⟶ 1,651:
fib2(x floor)
)</syntaxhighlight>
▲=={{header|IS-BASIC}}==
▲<syntaxhighlight lang="is-basic">100 PROGRAM "Fibonacc.bas"
▲110 FOR I=0 TO 10
▲120 PRINT FIB(I);
▲130 NEXT
▲140 DEF FIB(K)
▲150 SELECT CASE K
▲160 CASE IS<0
▲170 PRINT "Negative parameter to Fibonacci.":STOP
▲180 CASE 0
▲190 LET FIB=0
▲220 CASE ELSE
▲230 LET FIB=FIB(K-1)+FIB(K-2)
▲240 END SELECT
▲250 END DEF</syntaxhighlight>
=={{header|J}}==
Line 3,620 ⟶ 3,617:
=={{header|Wren}}==
<syntaxhighlight lang="
static compute(n) {
var fib
|