annotate tests/mini/foreach1.d @ 341:1bb99290e03a trunk

[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author lindquist
date Sun, 13 Jul 2008 02:51:19 +0200
parents test/foreach1.d@d9d5d59873d8
children
rev   line source
lindquist@33 1 module foreach1;
lindquist@270 2 extern(C) int printf(char*, ...);
lindquist@33 3
lindquist@33 4 void main()
lindquist@33 5 {
lindquist@33 6 static arr = [1,2,3,4,5];
lindquist@33 7
lindquist@270 8 printf("forward");
lindquist@33 9 foreach(v;arr) {
lindquist@270 10 printf(" %d",v);
lindquist@33 11 }
lindquist@270 12 printf("\nreverse");
lindquist@33 13 foreach_reverse(v;arr) {
lindquist@270 14 printf(" %d",v);
lindquist@33 15 }
lindquist@270 16 printf("\n");
lindquist@33 17 }