Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <windows.h>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- /// plansza 40 x 20
- HANDLE con = GetStdHandle(STD_OUTPUT_HANDLE);
- int faza = 1;
- int x = 11;
- int y = 5;
- int x1 = 10;
- int y1 = 3;
- int x2 = 30;
- int y2 = 10;
- int x3 = 15;
- int y3 = 16;
- void gotoxy(int x, int y)
- {
- COORD c;
- c.X = x-1;
- c.Y = y-1;
- SetConsoleCursorPosition (GetStdHandle (STD_OUTPUT_HANDLE), c);
- }
- void pole()
- {
- system("cls");
- SetConsoleTextAttribute(con, 255);
- for(int i=0; i<42; i++)
- {
- cout<<" ";
- }
- for(int i=2; i<22; i++)
- {
- cout<<endl<<" ";
- gotoxy(42, i);
- cout<<" ";
- }
- cout<<endl;
- for(int i=0; i<17; i++)
- {
- cout<<" ";
- }
- for(int i=0; i<17; i++)
- {
- gotoxy(i+26, 22);
- cout<<" ";
- }
- gotoxy(17, 23);
- cout<<" ";
- gotoxy(17, 24);
- cout<<" ";
- gotoxy(26, 23);
- cout<<" ";
- SetConsoleTextAttribute(con, 10);
- gotoxy(x1, y1);
- cout<<"o";
- gotoxy(x1, y1+1);
- cout<<"+";
- gotoxy(x1, y1+2);
- cout<<"^";
- gotoxy(x2, y2);
- cout<<"o";
- gotoxy(x2, y2+1);
- cout<<"+";
- gotoxy(x2, y2+2);
- cout<<"^";
- gotoxy(x3, y3);
- cout<<"o";
- gotoxy(x3, y3+1);
- cout<<"+";
- gotoxy(x3, y3+2);
- cout<<"^";
- SetConsoleTextAttribute(con, 15);
- gotoxy(x, y);
- cout<<"o";
- if(faza == 1)
- {
- gotoxy(x1-2, y1-1);
- cout<<"Ramos";
- }
- else if(faza == 2)
- {
- gotoxy(x2-2, y2-1);
- cout<<"Kante";
- }
- else if(faza == 3)
- {
- gotoxy(x3-3, y3-1);
- cout<<"Ronaldo";
- }
- }
- int main()
- {
- pole();
- y++;
- Sleep(200);
- pole();
- for(int i=0; i<6; i++)
- {
- for(int j=0; j<3; j++)
- {
- x++;
- Sleep(200);
- pole();
- }
- y++;
- pole();
- }
- faza = 2;
- pole();
- x--;
- Sleep(200);
- pole();
- for(int i=0; i<6; i++)
- {
- y++;
- Sleep(200);
- pole();
- for(int j=0; j<2; j++)
- {
- x--;
- Sleep(200);
- pole();
- }
- }
- faza = 3;
- pole();
- for(int i=0; i<4; i++)
- {
- for(int j=0; j<2; j++)
- {
- x++;
- Sleep(200);
- pole();
- }
- y++;
- Sleep(200);
- pole();
- }
- x++;
- Sleep(200);
- pole();
- y++;
- Sleep(200);
- pole();
- gotoxy(1, 25);
- SetConsoleTextAttribute(con, 15);
- /// Bartosz Kowalski 2019
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement