Extract expected result.
This commit is contained in:
parent
e963a7251c
commit
0d651f74ce
@ -84,6 +84,7 @@ Below is the standard _Fibonacci_ example for scripting languages:
|
|||||||
|
|
||||||
const TARGET = 28;
|
const TARGET = 28;
|
||||||
const REPEAT = 5;
|
const REPEAT = 5;
|
||||||
|
const ANSWER = 317_811;
|
||||||
|
|
||||||
fn fib(n) {
|
fn fib(n) {
|
||||||
if n < 2 {
|
if n < 2 {
|
||||||
@ -107,8 +108,8 @@ print(`Finished. Run time = ${now.elapsed} seconds.`);
|
|||||||
|
|
||||||
print(`Fibonacci number #${TARGET} = ${result}`);
|
print(`Fibonacci number #${TARGET} = ${result}`);
|
||||||
|
|
||||||
if result != 317_811 {
|
if result != ANSWER {
|
||||||
print("The answer is WRONG! Should be 317,811!");
|
print(`The answer is WRONG! Should be ${ANSWER}!`);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
const TARGET = 28;
|
const TARGET = 28;
|
||||||
const REPEAT = 5;
|
const REPEAT = 5;
|
||||||
|
const ANSWER = 317_811;
|
||||||
|
|
||||||
fn fib(n) {
|
fn fib(n) {
|
||||||
if n < 2 {
|
if n < 2 {
|
||||||
@ -26,6 +27,6 @@ print(`Finished. Run time = ${now.elapsed} seconds.`);
|
|||||||
|
|
||||||
print(`Fibonacci number #${TARGET} = ${result}`);
|
print(`Fibonacci number #${TARGET} = ${result}`);
|
||||||
|
|
||||||
if result != 317_811 {
|
if result != ANSWER {
|
||||||
print("The answer is WRONG! Should be 317,811!");
|
print(`The answer is WRONG! Should be ${ANSWER}!`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user