your computer program should be very user friendly: the program should always allow the person playing to play first and the person playing should always play as x.
the current display should look like the following
x - o
- x -
- - o
where the x is the person playing and o is the computer play and the - is an unplayed spot on the board
you should use the following notations for board play
1 2 3
4 5 6
7 8 9
and play on from their by computer and player
include message like (draw, win by person and win by person)
so i have this so far but its player vs player
please help me with thisssssssssss!!!!
Your game is fine. (Good :))
If you want to make a player machine which can fight with real (human) players, you'll need to put out these code into a function, looks like this :
First :
void SetSquare(int mark, int nPosition)
{
if (choice == 1 && square[1] == 'nPosition')
void SetSquare(int mark, int nPosition)
{
if (square[nPosition] == ('0' + nPosition))
square[nPosition] = mark;
}
Make sure your choices are valid (in proper range min = 1 ... and max = 9)
Second :
Try thinking yourself about CPU player. You'll only need to process some calculations then put the final value into "nPosition" value. It's easy, only It will take some time to practice and memorise... If you need help, please give more information, (maybe) I can help you... something.