Fix fibonacci example.
This commit is contained in:
parent
a6b78944c9
commit
562731c154
@ -76,7 +76,7 @@ Example
|
|||||||
|
|
||||||
The [`scripts`](https://github.com/rhaiscript/rhai/tree/master/scripts) subdirectory contains sample Rhai scripts.
|
The [`scripts`](https://github.com/rhaiscript/rhai/tree/master/scripts) subdirectory contains sample Rhai scripts.
|
||||||
|
|
||||||
Below is a the standard _Fibonacci_ example for scripting languages:
|
Below is the standard _Fibonacci_ example for scripting languages:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// This Rhai script calculates the n-th Fibonacci number using a really dumb algorithm
|
// This Rhai script calculates the n-th Fibonacci number using a really dumb algorithm
|
||||||
@ -93,7 +93,7 @@ fn fib(n) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print(`Running Fibonacci(28) x ${REPEAT} times...`);
|
print(`Running Fibonacci(${TARGET}) x ${REPEAT} times...`);
|
||||||
print("Ready... Go!");
|
print("Ready... Go!");
|
||||||
|
|
||||||
let result;
|
let result;
|
||||||
|
@ -12,7 +12,7 @@ fn fib(n) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print(`Running Fibonacci(28) x ${REPEAT} times...`);
|
print(`Running Fibonacci(${TARGET}) x ${REPEAT} times...`);
|
||||||
print("Ready... Go!");
|
print("Ready... Go!");
|
||||||
|
|
||||||
let result;
|
let result;
|
||||||
|
Loading…
Reference in New Issue
Block a user