Mattie

Untitled

May 12th, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. void een_voor_een()
  2. {
  3.     pos_x = rand() % 15;
  4.     pos_y = rand() % 10;
  5.     color = rand() % 7 + 31;
  6.     lengte = (int) strlen(text);
  7.  
  8.     iprintf("\x1b[2J"); // Clear screen
  9.     iprintf("\x1b[%i;%iH", pos_x, pos_y); // Set pos
  10.     iprintf("\x1b[%im", color); // Set graphics
  11.  
  12.     for (a = 0; a < lengte; a++)
  13.     {
  14.         color = rand() % 7 + 31;
  15.         iprintf("\x1b[%im", color); // Set graphics
  16.         iprintf("%c", text[a]); // Print text
  17.         for (i = 0; i < 50; i++)
  18.         {
  19.             swiWaitForVBlank();
  20.         }
  21.         if (a == lengte - 1)
  22.         {
  23.             //          usleep(10000); werkt niet helaas
  24.             for (i = 0; i < 500; i++)
  25.             {
  26.                 swiWaitForVBlank(); // dus gewoon even 500x op een nieuw frame wachten ;)
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment