diff --git a/README.md b/README.md index f3cef610..e11cf72f 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ Below is the standard _Fibonacci_ example for scripting languages: const TARGET = 28; const REPEAT = 5; +const ANSWER = 317_811; fn fib(n) { if n < 2 { @@ -107,8 +108,8 @@ print(`Finished. Run time = ${now.elapsed} seconds.`); print(`Fibonacci number #${TARGET} = ${result}`); -if result != 317_811 { - print("The answer is WRONG! Should be 317,811!"); +if result != ANSWER { + print(`The answer is WRONG! Should be ${ANSWER}!`); } ``` diff --git a/scripts/fibonacci.rhai b/scripts/fibonacci.rhai index dac77d22..8451c477 100644 --- a/scripts/fibonacci.rhai +++ b/scripts/fibonacci.rhai @@ -3,6 +3,7 @@ const TARGET = 28; const REPEAT = 5; +const ANSWER = 317_811; fn fib(n) { if n < 2 { @@ -26,6 +27,6 @@ print(`Finished. Run time = ${now.elapsed} seconds.`); print(`Fibonacci number #${TARGET} = ${result}`); -if result != 317_811 { - print("The answer is WRONG! Should be 317,811!"); +if result != ANSWER { + print(`The answer is WRONG! Should be ${ANSWER}!`); }