Skip to content

Instantly share code, notes, and snippets.

@Irwin1985
Created October 23, 2020 07:50
Show Gist options
  • Save Irwin1985/797e4170254a6546e3815129c1fbf895 to your computer and use it in GitHub Desktop.
Save Irwin1985/797e4170254a6546e3815129c1fbf895 to your computer and use it in GitHub Desktop.
// assignment
let x = 10;
print("El número es: " + x);
println("El número es: " + x);
// for statement
for x = 1 to 10
print("contando por el: " + x);
end
// while statement
while x < 11 do
x++
print("contando por el: " + x);
end
// function statement
fun factorial(n)
return 1 if n <= 1 else n * factorial(n-1);
end
// fibonacci function
fun fibonacci(n)
if n in [0, 1]
return 1
else
return fibonacci(n-1) + fibonacci(n-2)
endif
end
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment