Last active
December 16, 2016 03:12
-
-
Save rich-97/784344db4fed77f46550fa9e5f2a3e79 to your computer and use it in GitHub Desktop.
Suseción Fibonacci con la Shell Bash.
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
# Fibo between 0 and 30. | |
len=30 | |
arr=() | |
for (( i = 0; i < len; i++ )); do | |
if (( i > 0 )); then | |
let arr[i]="arr[i - 1] + arr[i - 2]" | |
else | |
let arr[i]=i | |
fi | |
echo ${arr[i]} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment