Advertisement
Garey

Fixed Code

Oct 18th, 2017
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include<iostream>
  2. #include<iomanip>
  3. #include <windows.h>
  4. using namespace std;
  5. void clearScreen()
  6. {
  7.     HANDLE hOut;
  8.     COORD Position;
  9.  
  10.     hOut = GetStdHandle(STD_OUTPUT_HANDLE);
  11.  
  12.     Position.X = 0;
  13.     Position.Y = 0;
  14.     SetConsoleCursorPosition(hOut, Position);
  15. }
  16. int main()
  17. {
  18.     CONSOLE_SCREEN_BUFFER_INFO csbi;
  19.     unsigned int frames;
  20.  
  21.     GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
  22.     frames = csbi.srWindow.Right - csbi.srWindow.Left + 1;
  23.  
  24.     for(size_t i=1;i<frames-1;i++)
  25.     {
  26.     clearScreen();
  27.     cout<<setw(i-5)<<"     _____"<<endl;
  28.     cout<<setw(i)<<"  __/__|__\\___"<<endl;
  29.     cout<<setw(i)<<"(_)--------(_)|"<<endl;
  30.     Sleep(50);
  31.     cout<< setfill('-') <<setw(frames) << '-' << endl;
  32.     cout << setfill(' ');
  33.  
  34.     }
  35.  
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement