root/trunk/qd/test.d

Revision 373, 414 bytes (checked in by FeepingCreature, 4 years ago)
  • Moved redimple to tools
  • Stuff
Line 
1 module test;
2 import qd, std.random;
3
4 import tools.base;
5 void delegate(proc) every(int i) {
6   return stuple(i, 0) /apply/ (int i, ref int count, proc p) {
7     count++;
8     if (count == i) { count = 0; p(); }
9   };
10 }
11
12 void main() {
13   screen(640, 480);
14   auto e = every(1024);
15   while (true) {
16     line(rand() % 640, rand() % 480, rand() % 640, rand() % 480, rgb.rand);
17     e({
18       flip;
19       events;
20     });
21   }
22 }
Note: See TracBrowser for help on using the browser.