Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- void gotoxy (int x, int y)
- {
- COORD c;
- c.X = x-1;
- c.Y = y-1;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
- }
- void boisko()
- {
- for(int i=3;i<29;i++)
- {
- gotoxy(3,i);
- cout<<"|";
- }
- for(int i=3;i<29;i++)
- {
- gotoxy(33,i);
- cout<<"|";
- }
- for(int i=3;i<34;i++)
- {
- gotoxy(i,3);
- cout<<"-";
- }
- for(int i=3;i<34;i++)
- {
- gotoxy(i,29);
- cout<<"-";
- }
- }
- void zawodnik()
- {
- gotoxy(5,7);
- cout<<"2";
- gotoxy(15,17);
- cout<<"10";
- gotoxy(9,22);
- cout<<"12";
- }
- void bramka()
- {
- gotoxy(15,29);
- cout<<"|__|";
- gotoxy(15,2);
- cout<<" __ ";
- gotoxy(15,3);
- cout<<"| |";
- }
- int main()
- {
- int j;
- for(j=1;j<11;j++)
- {
- boisko();
- zawodnik ();
- bramka();
- gotoxy(j+4,j+6);
- cout<<"o";
- Sleep(100);
- system("cls");
- }
- for(j=11;j<16;j++)
- {
- boisko();
- zawodnik();
- bramka();
- gotoxy(26-j,j+7);
- cout<<"o";
- Sleep(100);
- system("cls");
- }
- for(j=15;j<18;j++)
- {
- boisko();
- zawodnik();
- bramka();
- gotoxy(j-1,j+11);
- cout<<"o";
- Sleep(100);
- system("cls");
- }
- boisko();
- zawodnik();
- bramka();
- Sleep(5000);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement