SorinAlex

Untitled

Jan 29th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include <windows.h>
  4. class Culoare
  5. {
  6. public:
  7. Culoare(unsigned short c): cul(c) {}
  8. unsigned short cul;
  9. };
  10. ostream& operator<< (ostream& os,Culoare c)
  11. {
  12. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),c.cul);
  13. return os;
  14. }
  15. const Culoare BLACK=0,BLUE=1,GREEN=2,CYAN=3,RED=4,MAGENTA=5,BROWN=6,LIGHTGRAY=7;
  16. const Culoare DARKGRAY=8,LIGHTBLUE=9,LIGHTGREEN=10,LIGHTCYAN=11,LIGHTRED=12;
  17. const Culoare LIGHTMAGENTA=13,YELLOW=14,WHITE=15;
  18.  
  19. int main()
  20. {
  21. COORD coords;
  22. coords.X=15;
  23. coords.Y=4;
  24. HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);
  25. char text[22]="Voi desena un copac :";
  26. int masca[22]={7,7,7,7,15,11,10,13,12,14,7,7,7,7,7,7,7,7,7,7,7};
  27. for(int i=0;i<22;i++)
  28. {
  29. SetConsoleTextAttribute(hOut,masca[i]);
  30. cout<<text[i];
  31. Sleep(250);
  32. }
  33. cout
  34. <<endl
  35. <<GREEN
  36. <<" _-_"<<endl
  37. <<" /~~ ~~\\"<<endl
  38. <<" /~~ "<<RED<<"o"<<GREEN<<" ~~\\"<<endl
  39. <<"{ "<<RED<<"o"<<GREEN<<" }"<<endl
  40. <<" \\ _- -_ /"<<endl
  41. <<BROWN
  42. <<" \\\\ //"<<endl
  43. <<" | | "<<LIGHTGRAY<<" \2"<<BROWN<<endl
  44. <<" | | "<<LIGHTGRAY<<"/|/"<<BROWN<<endl
  45. <<" // \\\\"<<LIGHTGRAY<<" (\\"<<endl;
  46. for(int i=1;i<=4;i++)
  47. {
  48. SetConsoleCursorPosition(hOut,coords);cout<<RED<<'o';
  49. Sleep(850);
  50. if(i<4)
  51. cout<<"\b \b";
  52. coords.Y++;
  53. }
  54. SetConsoleCursorPosition(hOut,coords);
  55. cout<<LIGHTGRAY<<" <--Cum a descoperit Newton Gravitatia\n";
  56. return 0;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment