Hello guyz. I have done my first project about TicTacToe seample game, but now I want to add some new function witch allows u to play vs computer. Now in my project 2 player can play againts each other but I want P1 vs Computer. I have found some information but want alghorithm about this.
I am not sure where you got that code from, but while it looks like c++, I don't think it is. That is to say it is wrong in nearly every possible way.
First, a tic tac toe board has only 9 possible spaces, so an array of 10 makes no sense. Next, there is a function called fun. Is it meant to modify the array? You will need to pass your array into you function, but it takes no arguments. Finally, those if statements!! What are they meant to do exactly? It looks like maybe assign a space to 'o' but they use not the assign operator but the ==?