Created
October 23, 2020 07:50
-
-
Save Irwin1985/797e4170254a6546e3815129c1fbf895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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