author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Fri, 23 Nov 2012 19:28:10 +0000 | |
changeset 73 | 27469183da75 |
child 75 | 898c25a4e399 |
permissions | -rw-r--r-- |
73
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
{ n := 9; |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
minus1 := 0; |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
minus2 := 1; |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
temp := 0; |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
while n > 0 do { |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
temp := minus2; |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
minus2 := minus1 + minus2; |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
minus1 := temp; |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
n := n - 1 |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
}; |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
fib_res := minus2 |
27469183da75
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
} |