I make x,o game between two players and it is run but, please i want to know how i make this game between one player and the computer?
please i want an urgent reply..

Recommended Answers

All 5 Replies

sorry i need it in c++ programming language and i searched in the forum but i didn't find this question so, please i want an urgent reply

One way to about it would be to enter randomly either a 'X' or an 'O' at every turn of the computer. But this solution would not be very smart.

Another method could be exhausting all the possible states of the matrix by using conditional statements and then determining the best move. But this solution would be very lengthy.

You can probably check the extreme positions and if any one of them consists of the mark of the same type, then place that mark, if not then place randomly.

please can u write this part in c++ code to understand what u are saying more?

Ok thanks so much for your help..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.