### Tic Tac Toe Problem

Hi,
I have been working on a Tic Tac Toe game and i keep coming up with random preprocessing errors and random stuff about scopes, here is the code, can someone please tell me what is wrong with it...

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960`` ``````#include #include #include using namespace std; int main() { srand(static_cast(time(0))); const int ROWS = 3; const int COLLUMS = 3; char board[ROWS][COLLUMS] = {{'.', '.', '.'}, //Sets up the board {'.', '.', '.'}, {'.', '.', '.'}}; cout << "From top left corner, y then x\n"; //Instructions for (int i = 0;i < ROWS;++i) { for (int j = 0;j < COLLUMS;++j) { cout << board[i][j]; } cout << endl; } int user_input1; int user_input2; cin >> user_input1; //Gets user input for placement of X cin >> user_input2; board[user_input1][user_input2] = 'X'; for (int i = 0;i < ROWS;++i) { for (int j = 0;j < COLLUMS;++j) { cout << board[i][j]; } cout << endl; } void computer_guess() //Gets the computere to guess { int randguess1 = ((rand() % 3)+ 1); int randguess2 = ((rand() % 3)+ 1); if (board[randguess1][randguess2] == ' ' && board[randguess1][randguess2] != 'X') { board[randguess1][randguess2] = 'O'; } else { computer_guess(); } } return 0; //Not completed, i just want it to get your guess and the computers guess for now :) } ``````
Last edited on
read error codes and look on the internet what does they mean - then fix it yourself, otherwise you wont learn.

PS. that code is full of errors and it doesnt compile at all.
ps2. dont create functions in other functions, like `void computer_guess()` inside main.
Last edited on
Do you still need help with your game?
 ``12`` ``````const int ROWS = 3; const int COLLUMS = 3;``````

Your computer will recognize both object as interger, a value. Then this:

`char board[ROWS][COLLUMS]`