Unsandbox CLI implementations in 42 programming languages for the permacomputer project. Public domain software for code execution across all ecosystems. Languages: Python, JavaScript, Ruby, Go, Rust, C, C++, Java, Kotlin, C#, F#, Haskell, OCaml, Clojure, Scheme, Common Lisp, Erlang, Elixir, D, Nim, Zig, V, Dart, Groovy, Scala, Julia, R, Crystal, Fortran, COBOL, Prolog, Forth, Tcl, Raku, Lua, PHP, Perl, Bash, TypeScript, Objective-C, PowerShell, AWK Includes test suites and service lifecycle tests.
10 lines
207 B
Erlang
10 lines
207 B
Erlang
-module(fib).
|
|
-export([main/1]).
|
|
|
|
fib(N) when N =< 1 -> N;
|
|
fib(N) -> fib(N-1) + fib(N-2).
|
|
|
|
main(_) ->
|
|
lists:foreach(fun(I) ->
|
|
io:format("fib(~p) = ~p~n", [I, fib(I)])
|
|
end, lists:seq(0, 10)).
|