Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. char szachy[8][8] = { ' ', 'o', ' ', 'o', ' ', 'o', ' ', 'o',
  5. 'o', ' ', 'o', ' ', 'o', ' ', 'o', ' ',
  6. ' ', 'o', ' ', 'o', ' ', 'o', ' ', 'o',
  7. ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
  8. ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
  9. 'x', ' ', 'x', ' ', 'x', ' ', 'x', ' ',
  10. ' ', 'x', ' ', 'x', ' ', 'x', ' ', 'x',
  11. 'x', ' ', 'x', ' ', 'x', ' ', 'x', ' ', }; // o-biały pionek x-czarny pionek
  12.  
  13. void rysujplansze()
  14. {
  15. int i, j;
  16. cout << " 1 2 3 4 5 6 7 8 " << endl;
  17. for (i = 0; i < 8; i++)
  18. {
  19. cout << " ---------------------------------" << endl;
  20. cout << i + 1;
  21. for (j = 0; j < 8; j++)
  22. {
  23. cout << " | ";
  24. cout << szachy[i][j];
  25. }
  26. cout << " | " << endl;
  27. }
  28. cout << " ---------------------------------" << endl;
  29. }
  30.  
  31.  
  32. int main()
  33. {
  34. rysujplansze();
  35.  
  36. int x1, y1, x2, y2, w0, w1;
  37.  
  38.  
  39. do {
  40. cout << "Rusz sie bialym pionkiem " << endl;
  41. cout << "\nPodaj wspolrzedne pionka\n";
  42. cout << "Podaj wspolrzedna x(pion): \n";
  43. cin >> x1;
  44. cout << "Podaj wspolrzedna y(poziom): \n";
  45. cin >> y1;
  46.  
  47. } while (((y1 != 0 || y1 != 2) && (x1 % 2 != 1)) || ((y1 != 1) && (x1 % 2 != 0)));
  48. /*
  49. if (szachy[x1 - 1][y1 - 1] == 'o')
  50. {
  51. cout << "Podaj, gdzie chcesz ruszyc pionek \n";
  52. cout << "Podaj wspolrzedna x(pion): \n";
  53. cin >> x2;
  54. cout << "Podaj wspolrzedna y(poziom): \n";
  55. cin >> y2;
  56. }
  57. if (((x2 == x1 - 1) && (y2 == y1 + 1)) || ((x2 == x1 + 1) && (y2 == y1 + 1)))
  58. {
  59. szachy[y2 - 1][x2 - 1] = szachy[y1 - 1][x1 - 1];
  60. szachy[y1 - 1][x1 - 1] = ' ';
  61. }
  62.  
  63. } while (w1 == 1);*/
  64.  
  65. rysujplansze();
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement