daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest May 17th, 2018 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void    CScreen::Scatter()
  2. {
  3.         //create a matrix object and use attron and color_pair() to be used
  4.         // in order to fill the screen
  5.         CMatrix Screen(LINES, COLS);//LINES AND COLS from ncurses library.
  6.         //for(int i = 0; i < LAST_COLOR_PAIR_INDEX; ++i)
  7.         while(clock() < 120)
  8.         {
  9.                 int pair1 = rand() % 7 + 1;
  10.                 int pair2 = rand() % 7 + 1;
  11.                 if(pair1 != pair2)
  12.                 {
  13.                         attron(COLOR_PAIR(pair1));
  14.                         Screen.Fill(m_dispChar, m_sleep);
  15.                         refresh();
  16.                         usleep(999999);
  17.                 }
  18.         }
  19.  
  20. }  // end of "CScreen::Scatter"
RAW Paste Data
Top