![x and o google game x and o google game](https://www.tappaz.games/assets/images/101858832-286494142741113-2392959814064052750-n-1-1080x2240-800x1415.jpeg)
So the function uses the same variable as the calling function.
![x and o google game x and o google game](https://papers.co/wallpaper/papers.co-ml15-sunset-lake-night-blue-dark-nature-36-3840x2400-4k-wallpaper.jpg)
For a parameter definition, the & means it's a referenece. Thanks for reading I realise its a wall of text.ġ. Basicly what is it about declaring that makes it not count from 0 upwards but rather 1 upwards?ĥ)Finaly how would I go about condensing this and are there any bad habbits that I have picked up? Or any other comments that would help me improve? This is not an ai as far as I am concerned.Ĥ)Arrays why is it when I declare it it only allows 9 or higher but when used it wants 8. Simialr question about arrays instead when returning the value why do you use a "*"? I think it has something to do with pointers but I would like this explained please.Ģ)How would I go about making a very 'clean' win function, that checks for 3 in a row of either X or O.ģ) How would I go about making an actual ai? All I can do is make the ai choose a random number between 1 - 9 and then check to see if its taken. I have some questions that need to be answered before I move on.ġ)Why is it that when I am passing a variable to a function that is not void in order to use the value in the variable I have to place an "&" sign after declaring the variable type. read file and place data into array b place into a char fucntion return *b Printf( "Welcome to O and X - AI only game\nPlease select an option:\n1. Void ai( char b) // needs to be advanced temporary ai #include #include // for rand() using namespace std