Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #include <windows.h>
- class Culoare
- {
- public:
- Culoare(unsigned short c): cul(c) {}
- unsigned short cul;
- };
- ostream& operator<< (ostream& os,Culoare c)
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),c.cul);
- return os;
- }
- const Culoare BLACK=0,BLUE=1,GREEN=2,CYAN=3,RED=4,MAGENTA=5,BROWN=6,LIGHTGRAY=7;
- const Culoare DARKGRAY=8,LIGHTBLUE=9,LIGHTGREEN=10,LIGHTCYAN=11,LIGHTRED=12;
- const Culoare LIGHTMAGENTA=13,YELLOW=14,WHITE=15;
- int main()
- {
- COORD coords;
- coords.X=15;
- coords.Y=4;
- HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);
- char text[22]="Voi desena un copac :";
- int masca[22]={7,7,7,7,15,11,10,13,12,14,7,7,7,7,7,7,7,7,7,7,7};
- for(int i=0;i<22;i++)
- {
- SetConsoleTextAttribute(hOut,masca[i]);
- cout<<text[i];
- Sleep(250);
- }
- cout
- <<endl
- <<GREEN
- <<" _-_"<<endl
- <<" /~~ ~~\\"<<endl
- <<" /~~ "<<RED<<"o"<<GREEN<<" ~~\\"<<endl
- <<"{ "<<RED<<"o"<<GREEN<<" }"<<endl
- <<" \\ _- -_ /"<<endl
- <<BROWN
- <<" \\\\ //"<<endl
- <<" | | "<<LIGHTGRAY<<" \2"<<BROWN<<endl
- <<" | | "<<LIGHTGRAY<<"/|/"<<BROWN<<endl
- <<" // \\\\"<<LIGHTGRAY<<" (\\"<<endl;
- for(int i=1;i<=4;i++)
- {
- SetConsoleCursorPosition(hOut,coords);cout<<RED<<'o';
- Sleep(850);
- if(i<4)
- cout<<"\b \b";
- coords.Y++;
- }
- SetConsoleCursorPosition(hOut,coords);
- cout<<LIGHTGRAY<<" <--Cum a descoperit Newton Gravitatia\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment