@ -138,3 +138,15 @@ int wasGameWon(char field[3][3]){
return winner;
}
void getComputerInput(char field[3][3]){
bool symbolSet = false;
while (!symbolSet){
int row, col;
row = rand() % 3;
col = rand() % 3;
if (field[row][col] == '-'){
field[row][col] = 'X';
symbolSet = true;
@ -15,5 +15,6 @@ void initField(char field[3][3]);
void getPlayerInput(char field[3][3]);
bool validatePlayerInput(int row, int col);
int wasGameWon(char field[3][3]);
void getComputerInput(char field[3][3]);
#endif