[Solved] my else if statement isnt working in my tic tac toe program [duplicate]

if (currentstate == you_win){ System.out.println(“‘X’ Won!!”); else if (currentstate == comp_win) System.out.println(“‘O’ won!!”); else if (currentstate == draw) System.out.println(“It’s a Draw :(“); } Take a look at this line (and I removed some extraneous code to make this easier to see): if (currentstate == you_win){ else if (currentstate == comp_win) //… } Looking at it … Read more

[Solved] Creating a tic tac toe game. I want to create a 3×3 vector that stores the values for rows and columns then print out the board in the function

//Play Tic Tac Toe game between user and computer #include<iostream> #include<cstdio> #include<stdlib.h> #include<time.h> #define BLANK 5 using namespace std; /***************** Display the Matrix **********************************************/ //Display the matrix void display(int matrix[3][3]) { for(int i=0;i<3;i++){ for(int j=0;j<3;j++) cout<<matrix[i][j]<<“\t”; cout<<endl; } } /************** Chance of WIN Function *****************************************************/ //Funtion to detect the chance of either for user or … Read more