Fibonacci sequence: Difference between revisions
Content added Content deleted
m (PL/0: The last line of a "begin" compound statement must not be terminated with a semicolon. Unusual but true!) |
Langurmonkey (talk | contribs) |
||
Line 8,331: | Line 8,331: | ||
=={{header|langur}}== |
=={{header|langur}}== |
||
<syntaxhighlight lang="langur">val .fibonacci = fn(.x) if(.x < 2: .x ; self(.x - 1) + self(.x - 2)) |
<syntaxhighlight lang="langur">val .fibonacci = fn(.x) { if(.x < 2: .x ; self(.x - 1) + self(.x - 2)) } |
||
writeln map .fibonacci, series 2..20</syntaxhighlight> |
writeln map .fibonacci, series 2..20</syntaxhighlight> |