int checkWinner(cell)
{
//Do all your checks
//if you found out someone won,
//check if that cell is an 'x' or an 'o'
//if it's an 'x' return 1
//if it's an 'o' return 2
//if no one won,...
Type: Posts; User: rmatze
int checkWinner(cell)
{
//Do all your checks
//if you found out someone won,
//check if that cell is an 'x' or an 'o'
//if it's an 'x' return 1
//if it's an 'o' return 2
//if no one won,...
get rid of that return 'x'; return 'o'; That doesn't make any sense.
yes, now dont return a char. return an int telling if someone won. Try returning a 0 is no one has one yet, return a 1 if the user won or return a 2 if the computer won.
This part has some issues...
Use curly brackets for every if statement. Right now this is giving you what you think it should. I can't even indent it for you because it won't make sense.
...
You're missing the point. You won't need to end the game if you can even play it.
Here is a little more help, it's your code just modified a bit.
#include <stdio.h>
#include <stdlib.h>
...
That code will not compile. You need to write a few lines then compile and test, you are doing too much at one time.
Let's give you a little more direction. I've removed a lot of your code to...