Witam, uczę się programowania w codebloxie na informatyce w liceum i muszę napisać gre saper na zaliczenie. Niestety mam problem ponieważ program nie wypisuje w tabeli/planszy wybranych pól 'o' oraz po trafieniu w bombę nie wyświetla się komunikat o przegranej. Bardzo proszę o pomoc```cpp
#include <iostream>
#include <time.h>
#include <cstdlib>
const int SZEROKOSC_TABLICY = 10;
const int WYSOKOSC_TABLICY = 10;
using namespace std;
int main()
{
char tab[30] = { 'X' }, znaki[SZEROKOSC_TABLICY][WYSOKOSC_TABLICY]= { ' ' };
int h = 0, g = 0, x=1, wspolrzedna_y=0, wspolrzedna_x=0, proby, bomby=30;
srand(time(NULL));
cout << " " << "SAPER" << endl;
cout << endl;
cout << "+------------------------------------------+" << endl;
cout << "| x| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10|";
cout << endl;
for (int k = 0; k <10; k++)
{
do
{
h = rand()%10;
g = rand()%10;
}
while (znaki[h][g]=='X');
znaki[h][g] = 'X';
}
for (int i = 0; i < 10; i++)
{
if(x < 10)
cout << "| " << x;
else
cout << "|" << x;
x = x + 1;
for (int j = 0; j < 10; j++)
{
cout << "|" << " ";
}
cout << "|";
cout << endl;
}
cout << "+------------------------------------------+" << endl;
cout << endl;
x = 1;
cout << " Podaj wspolrzedne: ";
do
{
cin >> wspolrzedna_x;
cin >> wspolrzedna_y;
wspolrzedna_y = wspolrzedna_y - 1;
wspolrzedna_x = wspolrzedna_x - 1;
if(znaki[wspolrzedna_x][wspolrzedna_y]=='X')
{
cout << " Wdepnales na mine! Przegrales!" << endl;
}
else
{
znaki[wspolrzedna_x][wspolrzedna_y]=tab['o'];
cout << " Przezyles, probuj dalej" << endl;
}
cout << "+------------------------------------------+" << endl;
cout << "| x| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10|";
cout << endl;
for (int i = 0; i < 10; i++)
{
if(x < 10)
cout << "| " << x;
else
cout << "|" << x;
x = x + 1;
for (int j = 0; j < 10; j++)
{
if(znaki[i][j]==' ')
cout << "| " << znaki[i][j] << " ";
else
cout << "|" << " ";
}
cout << "|";
cout << endl;
}
cout << "+------------------------------------------+" << endl;
cout << endl;
x = 1;
cout << endl;
cout << " Podaj nastepne wspolrzedne" << endl;
}
while(znaki[wspolrzedna_x][wspolrzedna_y]!='X');
system("cls" );
if(znaki[wspolrzedna_x][wspolrzedna_y]=='o')
cout << endl << " Przejales wszystkie bezpieczne pola. Wygrales!" << endl;
return 0;
}