Commit b3fb4d18 authored by kenkeiras's avatar kenkeiras
Browse files

Added genie recursive fibonacci example

parent f43f1a9e
build:
valac fibonacci_recursivo.gs -o fibonacci_recursivo
clean:
rm -f fibonacci_recursivo
def fibonacci(n: int): int
if n < 2 do
return n
else
return fibonacci(n - 1) + fibonacci(n - 2)
init
var numero = 10
var resultado = fibonacci(numero)
stdout.printf ("Elemento nº %i de fibonacci: %i\n", numero, resultado)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment