Fix values
This commit is contained in:
parent
ae7d6c5359
commit
5edad332cd
19 changed files with 611 additions and 331 deletions
|
|
@ -3,8 +3,7 @@ fibonacci_numbers := [
|
|||
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377,
|
||||
610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657,
|
||||
46368, 75025, 121393, 196418, 317811, 514229, 832040,
|
||||
1346269, 2178309, 3524578, 5702887, 9227465, 14930352,
|
||||
24157817, 39088169, 63245986, 102334155
|
||||
1346269, 2178309, 3524578, 5702887, 9227465, 14930352
|
||||
]
|
||||
|
||||
func fib(n) {
|
||||
|
|
@ -15,14 +14,21 @@ func fib(n) {
|
|||
return fib(n-1) + fib(n-2)
|
||||
}
|
||||
|
||||
n := 0
|
||||
while n < fibonacci_numbers.length() {
|
||||
print("_")
|
||||
n = n + 1
|
||||
}
|
||||
|
||||
write("")
|
||||
|
||||
x := 0
|
||||
while x < fibonacci_numbers.length() {
|
||||
n := fib(x)
|
||||
|
||||
print("assert ")
|
||||
print(n)
|
||||
print(" == ")
|
||||
write(fibonacci_numbers.at(x))
|
||||
assert(n == fibonacci_numbers.at(x))
|
||||
assertEq(n, fibonacci_numbers.at(x))
|
||||
print("*")
|
||||
x = x + 1
|
||||
}
|
||||
|
||||
write("")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue