binary B+ tree - first attempt, compiles and runs
[svn/Cll1h/.git] / demos / repeat.c
index 7e8622e467de9fec17293d463b0d7c8fa2b321d2..491b74ddde05917cc6ed7b776aa41ba72f094eb7 100644 (file)
@@ -2,9 +2,35 @@
 
 program
 {
- repeat(2)
+ int i=2;
+ repeat(1)
  {
-  printf("Tohle cele delam 2x:\n");
-  repeat(3) printf("Tohle delam 3x...\n");
- }
+  print("This is demonstration, that nesting of C<<1 repeat(N) { ... } flow-control macro is completely safe:");
+  repeat(i++)
+  {
+   echo("This loop is supposed to be repeated twice: ");
+   repeat(i)
+   {
+    printf("[doing this %d times] ",i);
+   } 
+   repeat(0)
+   {
+    printf("[doing this 0 times] ",i);
+   }
+   repeat(-1)
+   {
+    printf("[doing this -1 times] ",i);
+   }
+   repeat(1)
+   {
+    printf("[doing this 1 times] ",i);
+   }
+   print("... finished.");
+  }
+ } 
+ repeat(--i)
+ {
+  print("This loop is not nested and it is supposed to be repeated again just twice.");
+ } 
 }
This page took 0.112702 seconds and 4 git commands to generate.