mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 03:12:20 +00:00
Move Roc CLI testing examples to crates/
This commit is contained in:
parent
2eec200f09
commit
527f39b8f2
75 changed files with 56 additions and 49 deletions
13
crates/cli_testing_examples/algorithms/fibonacci.roc
Normal file
13
crates/cli_testing_examples/algorithms/fibonacci.roc
Normal file
|
@ -0,0 +1,13 @@
|
|||
app "fibonacci"
|
||||
packages { pf: "fibonacci-platform/main.roc" }
|
||||
imports []
|
||||
provides [main] to pf
|
||||
|
||||
main = \n -> fib n 0 1
|
||||
|
||||
# the clever implementation requires join points
|
||||
fib = \n, a, b ->
|
||||
if n == 0 then
|
||||
a
|
||||
else
|
||||
fib (n - 1) b (a + b)
|
Loading…
Add table
Add a link
Reference in a new issue