whatcanGOwrong
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
# Tests of Starlark recursion and while statement.
|
||||
|
||||
# This is a "chunked" file: each "---" effectively starts a new file.
|
||||
|
||||
# option:recursion
|
||||
|
||||
load("assert.star", "assert")
|
||||
|
||||
def fib(n):
|
||||
if n <= 1:
|
||||
return 1
|
||||
return fib(n-1) + fib(n-2)
|
||||
|
||||
assert.eq(fib(5), 8)
|
||||
Reference in New Issue
Block a user