Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- char szachy[8][8] = { ' ', 'o', ' ', 'o', ' ', 'o', ' ', 'o',
- 'o', ' ', 'o', ' ', 'o', ' ', 'o', ' ',
- ' ', 'o', ' ', 'o', ' ', 'o', ' ', 'o',
- ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
- ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
- 'x', ' ', 'x', ' ', 'x', ' ', 'x', ' ',
- ' ', 'x', ' ', 'x', ' ', 'x', ' ', 'x',
- 'x', ' ', 'x', ' ', 'x', ' ', 'x', ' ', }; // o-biały pionek x-czarny pionek
- void rysujplansze()
- {
- int i, j;
- cout << " 1 2 3 4 5 6 7 8 " << endl;
- for (i = 0; i < 8; i++)
- {
- cout << " ---------------------------------" << endl;
- cout << i + 1;
- for (j = 0; j < 8; j++)
- {
- cout << " | ";
- cout << szachy[i][j];
- }
- cout << " | " << endl;
- }
- cout << " ---------------------------------" << endl;
- }
- int main()
- {
- rysujplansze();
- int x1, y1, x2, y2, w0, w1;
- do {
- cout << "Rusz sie bialym pionkiem " << endl;
- cout << "\nPodaj wspolrzedne pionka\n";
- cout << "Podaj wspolrzedna x(pion): \n";
- cin >> x1;
- cout << "Podaj wspolrzedna y(poziom): \n";
- cin >> y1;
- } while (((y1 != 0 || y1 != 2) && (x1 % 2 != 1)) || ((y1 != 1) && (x1 % 2 != 0)));
- /*
- if (szachy[x1 - 1][y1 - 1] == 'o')
- {
- cout << "Podaj, gdzie chcesz ruszyc pionek \n";
- cout << "Podaj wspolrzedna x(pion): \n";
- cin >> x2;
- cout << "Podaj wspolrzedna y(poziom): \n";
- cin >> y2;
- }
- if (((x2 == x1 - 1) && (y2 == y1 + 1)) || ((x2 == x1 + 1) && (y2 == y1 + 1)))
- {
- szachy[y2 - 1][x2 - 1] = szachy[y1 - 1][x1 - 1];
- szachy[y1 - 1][x1 - 1] = ' ';
- }
- } while (w1 == 1);*/
- rysujplansze();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement