Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <stdlib.h>
  4. using std::cout;
  5. using std::cin;
  6. using std::endl;
  7.  
  8. #define AlphabetSIZE 36
  9. #define White 15
  10. #define Green 2
  11. #define SymbolsSIZE 8
  12.  
  13. char Alphabet[] = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'};
  14. char Symbol[] = {'!','@','#','$','%','&','=','+'};
  15.  
  16. int main()
  17. {
  18.     short int c;
  19.     short int f;
  20.     char input;
  21.     short int counter = 0;
  22.     short int color = Green;
  23.     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),color);
  24.     while(1)
  25.     {
  26.         for(int i=0; i<AlphabetSIZE;i++)
  27.         {
  28.             c = rand() % AlphabetSIZE;
  29.             f = rand() % SymbolsSIZE;
  30.             cout << Alphabet[c];
  31.             if(counter %20 == 0)
  32.             {
  33.                 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),White);
  34.                 cout << Symbol[f];
  35.             }
  36.             SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),Green);
  37.             counter++;
  38.         }
  39.         cout << "\n";
  40.         Sleep(25);
  41.     }
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement