From 093e9e93c911498753b9e5a80ec9f8dac77017df Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Thu, 26 Jan 2023 16:27:40 +0100 Subject: [PATCH] add Fibonacci sequence --- calc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/calc.c b/calc.c index ed67da4..439ab24 100644 --- a/calc.c +++ b/calc.c @@ -299,4 +299,7 @@ int main (int argc, char *argv[]) // test: echo -e '{\n{}\n{1, 2\n{sto (1, 1 + 1),\npow(2, {sto (1, 1 + 2), 2}, {rcl(2)})\n2 {sto (1, 1 + 1)}' | calc.exe | grep -c error | xargs test 6 = // test: echo -e '1 }\n1 )\n1 , 2\n ' | calc.exe | grep -c error | xargs test 3 = +// Fibonacci sequence +// test: echo -e '{sto (1, 1), sto (2, 1), sto (10, 1), whl (inc (10) < 12 - 1, {sto (3, rcl (1) + rcl (2)), sto (1, rcl (2)), sto (2, rcl (3))})}' | calc.exe | grep '=> 144' + /* vim: set ts=4 sw=4 et: */ -- 2.30.2