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
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.