Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. using namespace std;
  4. void gotoxy (int x, int y)
  5.  
  6. {
  7. COORD c;
  8. c.X = x-1;
  9. c.Y = y-1;
  10. SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
  11.  
  12. }
  13. void boisko()
  14. {
  15. for(int i=3;i<29;i++)
  16. {
  17. gotoxy(3,i);
  18. cout<<"|";
  19. }
  20. for(int i=3;i<29;i++)
  21. {
  22. gotoxy(33,i);
  23. cout<<"|";
  24. }
  25. for(int i=3;i<34;i++)
  26. {
  27. gotoxy(i,3);
  28. cout<<"-";
  29. }
  30. for(int i=3;i<34;i++)
  31. {
  32. gotoxy(i,29);
  33. cout<<"-";
  34. }
  35. }
  36. void zawodnik()
  37. {
  38. gotoxy(5,7);
  39. cout<<"2";
  40. gotoxy(15,17);
  41. cout<<"10";
  42. gotoxy(9,22);
  43. cout<<"12";
  44. }
  45.  
  46. void bramka()
  47. {
  48. gotoxy(15,29);
  49. cout<<"|__|";
  50.  
  51. gotoxy(15,2);
  52. cout<<" __ ";
  53. gotoxy(15,3);
  54. cout<<"| |";
  55. }
  56. int main()
  57. {
  58. int j;
  59. for(j=1;j<11;j++)
  60.  
  61. {
  62. boisko();
  63. zawodnik ();
  64. bramka();
  65. gotoxy(j+4,j+6);
  66. cout<<"o";
  67. Sleep(100);
  68. system("cls");
  69. }
  70. for(j=11;j<16;j++)
  71. {
  72. boisko();
  73. zawodnik();
  74. bramka();
  75. gotoxy(26-j,j+7);
  76. cout<<"o";
  77. Sleep(100);
  78. system("cls");
  79. }
  80. for(j=15;j<18;j++)
  81. {
  82. boisko();
  83. zawodnik();
  84. bramka();
  85. gotoxy(j-1,j+11);
  86. cout<<"o";
  87. Sleep(100);
  88. system("cls");
  89. }
  90. boisko();
  91. zawodnik();
  92. bramka();
  93. Sleep(5000);
  94. return 0;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement