Help With TiC Tac Toe

Hi GUys,
I've to Make a Tic Tac Toe game this are the things i need to add in it.
This is a game that computer play with it self.but
1)first ask for two user names
2) then this is the board.
   |   |   
   |   |   
   |   |   

3)Now i have to put "o" and "x" in those blank spaces but no idea how do i insert o OR x in it
4) Also checking for winner eachtime we insert a o OR x
5) Last just show the winner.
Any Help appreciated
Do you have code for us look at?

I'm still learning(very beginner level), but I would possibly go about it using an Array. Then use rand() to make it choose a spot on the board. Make sure to check it is an empty spot also. Just constantly compare the blocks to see if three of them equal each other.

That's just some thoughts off the top of my head that may help.
If you are trying to make it make intelligent decisions, that is beyond me.
(Although I could possibly have it make decisions based on if there is an o or x in two spots with a gap in between using many if statements)
But randomly placing it on the board is how I would go about it with what I know.

But at least give us some code to work off of.
Sorry Guys , No Code yet.
And i had the same idea in my mind too as "Tarkle" Said but dont know how to start
Have you read any of the other posts here yet? I'm sure I just read the same question come up her a few days ago.

Last edited on
Topic archived. No new replies allowed.