aboutsummaryrefslogtreecommitdiff
path: root/vendor/cmilan/test/loop.mil
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 06:49:14 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 06:49:14 +0000
commit0e856ca15d8aa1499edc33c7302d4d97be404290 (patch)
treed2bb840d13c57aa17f643e6039af370255e38379 /vendor/cmilan/test/loop.mil
downloadlab-04-0e856ca15d8aa1499edc33c7302d4d97be404290.tar.gz
publishHEADmaster
Diffstat (limited to 'vendor/cmilan/test/loop.mil')
-rw-r--r--vendor/cmilan/test/loop.mil17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/cmilan/test/loop.mil b/vendor/cmilan/test/loop.mil
new file mode 100644
index 0000000..c2f6d64
--- /dev/null
+++ b/vendor/cmilan/test/loop.mil
@@ -0,0 +1,17 @@
1BEGIN
2 /* Read a number */
3
4 i := READ;
5
6 /* Count from 0 to this number */
7
8 IF i > 0 THEN step := 1 ELSE step := -1 FI;
9 k := 0;
10 WHILE k != i DO
11 WRITE(k);
12 k := k + step
13 OD;
14
15 WRITE(i)
16END
17