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.
12 lines
201 B
Elixir
12 lines
201 B
Elixir
defmodule Fib do
|
|
def fib(n) when n <= 1, do: n
|
|
def fib(n), do: fib(n-1) + fib(n-2)
|
|
|
|
def main do
|
|
Enum.each(0..10, fn i ->
|
|
IO.puts("fib(#{i}) = #{fib(i)}")
|
|
end)
|
|
end
|
|
end
|
|
|
|
Fib.main()
|