Fibonacci sequence: Difference between revisions

m
PL/0: The last line of a "begin" compound statement must not be terminated with a semicolon. Unusual but true!
(Added to Yabasic recursive, analytical and sequence methods using the Binet formula)
m (PL/0: The last line of a "begin" compound statement must not be terminated with a semicolon. Unusual but true!)
(3 intermediate revisions by 3 users not shown)
Line 3,018:
150 END
</syntaxhighlight>
 
==={{header|Tiny Craft Basic}}===
<syntaxhighlight lang="basic">10 cls
 
20 let a = 1
30 let b = 1
 
40 print "Fibonacci Sequence"
 
50 rem loop
 
60 let s = a + b
70 let a = b
80 let b = s
90 let i = i + 1
 
100 print s
 
120 if i < 20 then 50
 
130 shell "pause"
140 end</syntaxhighlight>
 
==={{header|True BASIC}}===
Line 8,353 ⟶ 8,331:
 
=={{header|langur}}==
<syntaxhighlight lang="langur">val .fibonacci = ffn(.x) if(.x < 2: .x ; self(.x - 1) + self(.x - 2))
 
writeln map .fibonacci, series 2..20</syntaxhighlight>
Line 11,242 ⟶ 11,220:
i := i + 1
end;
! b;
end.
</syntaxhighlight>
Line 14,425 ⟶ 14,403:
fibionacci 46=1836311903
</pre>
 
==={{header|Tiny Craft BasicUiua}}===
{{works with|Uiua|0.10.0-dev.1}}
Simple recursive example with memoisation.
<syntaxhighlight lang="basicUiua">10 cls
F ← |1 memo⟨+⊃(F-1)(F-2)|∘⟩<2.
F ⇡20
140 end</syntaxhighlight>
 
=={{header|UNIX Shell}}==