I'll explain you the concept here.
Lets create a two user game.
Input the coordinates of the grid where user1 wants to mark a 'O'.
store your X and O in a 3*3 array. Also, check if that spot was empty. if not, ask the same user to enter again. if yes, store the input in that spot.
Now, check if any of the diagonals/rows/columns have all the 'X' (will change to 'O' in case of user2 so it goes as a parameter to the function that you have to create for this step)
now change the user to user2 and repeat.
First write a pseudo-code for this on the comments here.. then we'll proceed.
I'll explain you the concept here. Lets create a two user game.
First write a pseudo-code for this on the comments here.. then we'll proceed.