From c6d8766bc305eaeec7b1a4b9eb772a47547a1db4 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 10 Jan 2025 04:08:10 +1100 Subject: [PATCH] Added scripts/benchpress.toy This file works in Toy v1 and Toy v2, but currently causes an SO. See #171 --- scripts/benchpress.toy | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/benchpress.toy diff --git a/scripts/benchpress.toy b/scripts/benchpress.toy new file mode 100644 index 0000000..e1714b1 --- /dev/null +++ b/scripts/benchpress.toy @@ -0,0 +1,17 @@ +//calculate the nth fibonacci number, and print it +//can't use functions yet + +var counter: int = 0; + +var first: int = 1; +var second: int = 0; + +while (counter < 100_000) { + var third: int = first + second; + first = second; + second = third; + + print third; + + ++counter; +} \ No newline at end of file