diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-20 00:51:23 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-20 00:51:23 +0100 |
commit | b0e2d13f1134f4b9b640012632004eb7f1dd447d (patch) | |
tree | 536bbc64b2a70c4d4bb5a27dfdb988ab02005cc5 | |
parent | Start working on proper operator precedence (diff) | |
download | interpreter-b0e2d13f1134f4b9b640012632004eb7f1dd447d.tar.gz interpreter-b0e2d13f1134f4b9b640012632004eb7f1dd447d.tar.bz2 interpreter-b0e2d13f1134f4b9b640012632004eb7f1dd447d.zip |
Example: Add example for while loop
-rw-r--r-- | examples/10.src | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/10.src b/examples/10.src new file mode 100644 index 0000000..38e6259 --- /dev/null +++ b/examples/10.src @@ -0,0 +1,13 @@ +let main = () => { + let counter = 0; + + while !(counter == 10) { + print(counter); + }; + + while counter == 0 { + print(0); + }; + + return counter; +}; |