From e3bb9a4ddc0465d4a75ca64e36416a9568c74d27 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 19 Oct 2024 21:43:48 +0300 Subject: some basic programs run --- examples/loop.lyn | 6 ++++++ examples/primitive.lyn | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 examples/loop.lyn create mode 100644 examples/primitive.lyn (limited to 'examples') diff --git a/examples/loop.lyn b/examples/loop.lyn new file mode 100644 index 0000000..0304672 --- /dev/null +++ b/examples/loop.lyn @@ -0,0 +1,6 @@ +let sum 0 +for {let i 0} {< i 1000000} {set i (+ i 1)} { + set sum (+ sum i) +} + +println sum diff --git a/examples/primitive.lyn b/examples/primitive.lyn new file mode 100644 index 0000000..4ebcf74 --- /dev/null +++ b/examples/primitive.lyn @@ -0,0 +1,5 @@ +let x 0 +println x + +set x 1 +println x -- cgit v1.2.3