Question

TIC TAC TOE in openGL/ C++

I just cannot figure out how to get the game to alternate turns. it is designed to be a 2 player game. the problem is once either an x or an o is placed it will onlycontinue to place the x or the o.please show me how to do the rest here is my code:

//#include <windows.h> // This header file will be needed for some windows compilers
//#include <GL/gl.h> // gl.h and glu.h also maybe needed for some compilers
//#include <GL/glu.h>
#include <GL/glut.h> // glut (gl utility toolkit) basic windows functions, keyboard, mouse.
#include <stdio.h> // standard (I/O library)
#include <stdlib.h> // standard library (set of standard C functions
#include <math.h> // Math library (Higher math functions )
#include <string.h>

// lighting
GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
GLfloat LightDiffuse[]= { 0.5f, 0.5f, 0.5f, 1.0f };
GLfloat LightPosition[]= { 5.0f, 25.0f, 5.0f, 1.0f };
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };

// mouse variables: Win = windows size, mouse = mouse position
int mouse_x, mouse_y, Win_x, Win_y, object_select;

// state variables for Orho/Perspective view, lighting on/off
static int view_state = 0, light_state = 0;

// Use to spin X's and O's
int spin, spinboxes;

// Win = 1 player wins, -1 player2 wins, 2 tie.
// player or player2; 1 = X, -1 = O
// start_game indicates that game is in play.
int player, player2, win, start_game;


// alingment of boxes in which one can win
// We have 8 posiblities, 3 accross, 3 down and 2 diagnally
//
// 0 | 1 | 2
// 3 | 4 | 5
// 6 | 7 | 8
//
// row, colunm, diagnal information

static int box[8][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {0, 3, 6},
{1, 4, 7}, {2, 5, 8}, {0, 4, 8}, {2, 4, 6}};

// Storage for our game board
// 1 = X's, -1 = O's, 0 = open space

int box_map[9];
// center x,y location for each box
int object_map[9][2] = {{-6,6},{0,6},{6,6},{-6,0},{0,0},{6,0},{-6,-6},{0,-6},{6,-6}};

// quadric pointer for build our X
GLUquadricObj *Cylinder;

// Begin game routine
void init_game(void)
{
int i;

// Clear map for new game
for( i = 0; i < 9; i++)
{
box_map[i] = 0;
}

// Set 0 for no winner
win = 0;
start_game = 1;
}


// Check for three in a row/colunm/diagnal
// returns 1 if there is a winner
int check_move( void )
{

int i, t = 0;

//Check for three in a row
for( i = 0; i < 8; i++)
{
t = box_map[box[i][0]] + box_map[box[i][1]] + box_map[box[i][2]];
if ( (t == 3) || ( t == -3) )
{
spinboxes = i;
return( 1 );
}
}
t = 0;
// check for tie
for( i = 0; i < 8; i++)
{
t = t + abs(box_map[box[i][0]]) + abs( box_map[box[i][1]]) + abs( box_map[box[i][2]]);
}

if ( t == 24 ) return( 2 );

return( 0 );
}





// I use this to put text on the screen
void Sprint( int x, int y, char *st)
{
int l,i;

l=strlen( st ); // see how many characters are in text string.
glRasterPos2i( x, y); // location to start printing text
for( i=0; i < l; i++) // loop until i is greater then l
{
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, st[i]); // Print a character on the screen
}

}


// This creates the spinning of the cube.
static void TimeEvent(int te)
{

spin++; // increase cube rotation by 1
if (spin > 360) spin = 0; // if over 360 degress, start back at zero.
glutPostRedisplay(); // Update screen with new rotation data
glutTimerFunc( 10, TimeEvent, 1); // Reset our timmer.
}


// Setup our Opengl world, called once at startup.
void init(void)
{
glClearColor (1.0, 1.0, 1.0, 0.0); // When screen cleared, use black.
glShadeModel (GL_SMOOTH); // How the object color will be rendered smooth or flat
glEnable(GL_DEPTH_TEST); // Check depth when rendering
// Lighting is added to scene
glLightfv(GL_LIGHT1 ,GL_AMBIENT, LightAmbient);
glLightfv(GL_LIGHT1 ,GL_DIFFUSE, LightDiffuse);
glLightfv(GL_LIGHT1 ,GL_POSITION, LightPosition);
glEnable(GL_LIGHTING); // Turn on lighting
glEnable(GL_LIGHT1); // Turn on light 1

start_game = 0;
win = 0;

// Create a new quadric
Cylinder = gluNewQuadric();
gluQuadricDrawStyle( Cylinder, GLU_FILL );
gluQuadricNormals( Cylinder, GLU_SMOOTH );
gluQuadricOrientation( Cylinder, GLU_OUTSIDE );
}


void Draw_O(int x, int y, int z, int a)
{

glPushMatrix();
glTranslatef(x, y, z);
glRotatef(a, 1, 0, 0);
glutSolidTorus(0.5, 2.0, 8, 16);
glPopMatrix();

}


void Draw_X(int x, int y, int z, int a)
{

glPushMatrix();
glTranslatef(x, y, z);
glPushMatrix();
glRotatef(a, 1, 0, 0);
glRotatef(90, 0, 1, 0);
glRotatef(45, 1, 0, 0);
glTranslatef( 0, 0, -3);
gluCylinder( Cylinder, 0.5, 0.5, 6, 16, 16);
//glutSolidCone( 2.5, 3.0, 16, 8 );
glPopMatrix();
glPushMatrix();
glRotatef(a, 1, 0, 0);
glRotatef(90, 0, 1, 0);
glRotatef(315, 1, 0, 0);
glTranslatef( 0, 0, -3);
gluCylinder( Cylinder, 0.5, 0.5, 6, 16, 16);
//glutSolidCone( 2.5, 3.0, 16, 8 );
glPopMatrix();
glPopMatrix();

}

// Draw our world
void display(void)
{

char txt[30];
int ix, iy;
int i;
int j;

glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Clear the screen

glMatrixMode (GL_PROJECTION); // Tell opengl that we are doing project matrix work
glLoadIdentity(); // Clear the matrix
glOrtho(-9.0, 9.0, -9.0, 9.0, 0.0, 30.0); // Setup an Ortho view
glMatrixMode(GL_MODELVIEW); // Tell opengl that we are doing model matrix work. (drawing)
glLoadIdentity(); // Clear the model matrix

glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
glColor3f(0.0, 0.0, 1.0);

if ( start_game == 0 )
{
Sprint(-2, 0, "Tic Tac Toe");
Sprint(-3, -1, "To Start press");
Sprint(-3, -2, "right button for X's");
Sprint(-3, -3, "and left for O's");
}

if (win == 1) Sprint( -2, 1, "Player 1 Wins");
if (win == -1) Sprint( -2, 1, "Player 2 Wins");
if (win == 2) Sprint( -2, 1, "Tie");

// Setup view, and print view state on screen
if (view_state == 1)
{
glColor3f( 0.0, 0.0, 1.0);
Sprint(-3, 8, "Perspective view");
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
gluPerspective(60, 1, 1, 30);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}else
{
glColor3f( 0.0, 0.0, 1.0);
Sprint(-2, 8, "Ortho view");
}

// Lighting on/off
if (light_state == 1)
{
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL);
}else
{
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
}


gluLookAt( 0, 0, 20, 0, 0, 0, 0, 1, 0);


// Draw Grid
for( ix = 0; ix < 4; ix++)
{
glPushMatrix();
glColor3f(1,1,1);
glBegin(GL_LINES);
glVertex2i(-9 , -9 + ix * 6);
glVertex2i(9 , -9 + ix * 6 );
glEnd();
glPopMatrix();
}
for( iy = 0; iy < 4; iy++ )
{
glPushMatrix();
glColor3f(1,1,1);
glBegin(GL_LINES);
glVertex2i(-9 + iy * 6, 9 );
glVertex2i(-9 + iy * 6, -9 );
glEnd();
glPopMatrix();
}

glColorMaterial(GL_FRONT, GL_AMBIENT);
glColor4f(0.5, 0.5, 0.5, 1.0);
glColorMaterial(GL_FRONT, GL_EMISSION);
glColor4f(0.0, 0.0, 0.0, 1.0 );
glColorMaterial(GL_FRONT, GL_SPECULAR);
glColor4f(0.35, 0.35, 0.35, 1.0);
glColorMaterial(GL_FRONT, GL_DIFFUSE);
glColor4f(0.69, 0.69, 0.69, 1.0);
//glDisable(GL_COLOR_MATERIAL);
glColor3f( 1.0, 0.0, 1.0); // Cube color
//glEnable(GL_COLOR_MATERIAL);

// Draw object in box's

for( i = 0; i < 9; i++)
{
j = 0;
if (abs( win ) == 1 )
{
if ( (i == box[spinboxes][0]) || (i == box[spinboxes][1]) || (i == box[spinboxes][2]))
{
j = spin;
}else j = 0;
}
if(box_map[i] == 1) Draw_X( object_map[i][0], object_map[i][1], -1, j);

if(box_map[i] == -1) Draw_O( object_map[i][0], object_map[i][1], -1, j);
}

//glDisable(GL_COLOR_MATERIAL);

glutSwapBuffers();
}

// This is called when the window has been resized.
void reshape (int w, int h)
{
Win_x = w;
Win_y = h;
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
}


// Read the keyboard
void keyboard (unsigned char key, int x, int y)
{
switch (key)
{

case 'v':
case 'V':
view_state = abs(view_state -1);
break;
case 'l':
case 'L':
light_state = abs(light_state -1);
break;
case 27:
exit(0); // exit program when [ESC] key presseed
break;
default:
break;
}


}


void mouse(int button, int state, int x, int y)
{
// We convert windows mouse coords to out openGL coords
mouse_x = (18 * (float) ((float)x/(float)Win_x))/6;
mouse_y = (18 * (float) ((float)y/(float)Win_y))/6;

// What square have they clicked in?
object_select = mouse_x + mouse_y * 3;

if ( start_game == 0)
{
if ((button == GLUT_RIGHT_BUTTON) &&(state == GLUT_DOWN))
{
player = 1;
player2 = -1;
init_game();
return;
}

if ((button == GLUT_LEFT_BUTTON) &&(state == GLUT_DOWN))
{
player = -1;
player2 = 1;
init_game();
return;
}
}

if ( start_game == 1)
{
if ((button == GLUT_LEFT_BUTTON) &&(state == GLUT_DOWN))
{
if (win == 0)
{
if (box_map[ object_select ] == 0)
{
box_map[ object_select ] = player;
win = check_move();
if (win == 1)
{
start_game = 0;
return;
}
win = check_move();
if (win == 1)
{
win = -1;
start_game = 0;
}
}
}
}
}

if ( win == 2 )start_game = 0;

}


// Main program
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (500, 500);
glutInitWindowPosition (10, 10);
glutCreateWindow ("X's and O's 3D");
init ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMouseFunc(mouse);
glutTimerFunc( 10, TimeEvent, 1);
glutMainLoop();
return 0;
}

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

class TicTacToe
{
public:
TicTacToe(); // constructor
int Pick_Player(); // member function
int Pick_Row(); // member functions
int Pick_Column(); // member functions
int Check_Board(); // member function
void Choice_by_Player(int); // member functions
void Choice_of_Row(int); // member functions
void Choice_of_Column(int); // member functions
void Tic_Tac_Toe_Board(); // member functions
bool Check_Move(int,int); // member functions
private:
int row;
int column;
int player;
int board[3][3];
char display_board[3][3];
};

TicTacToe::TicTacToe()//:row(0):column(0):player(1):board(0)(0):display_board(' ')(' ')
{
row = 0;
column = 0;
player = 1;
int i = 0;
int j = 0;
for ( i = 0; i < 3; i++)
{
for ( j = 0; j < 3; j++)
{
board[i][j] = 0;
display_board[i][j] = ' ';
}
}
}

int TicTacToe::Pick_Player()
{
return player;
}

int TicTacToe::Pick_Row()
{
return row;
}

int TicTacToe::Pick_Column()
{
return column;
}

void TicTacToe::Choice_by_Player(int a)
{
player = a;
}

void TicTacToe::Choice_of_Row(int b)
{
row = b;
}

void TicTacToe::Choice_of_Column(int c)
{
column = c;
}

bool TicTacToe::Check_Move(int row, int column)
{
row = 0;
column = 0;

if ( row != 0 &&row != 1 &&row != 2 )
{
cout << " Invalid choice!!";
cout << endl;
return 0;
}
else if ( column != 0 &&column != 1 &&column != 2 )
{
cout << " Invalid choice!! " << endl;
return 0;
}
else if ( board[row][column] == 1 || board[row][column] == 2)
{
cout << " Space already used. Try Again. " << endl;
return 0;
}
else
{
board[row][column] = player;
return 1;
}
} // end of Check_Move

int TicTacToe::Check_Board()
{
int i = 0;
int j = 0;
int sum = 0;
int test = 0;
int count = 0;

for (i = 0; i < 3; i++)
{
sum = 0;
for ( j = 0; j < 3; j++)
{
if (board[i][j] == 0)
{
count++;
}
sum += (board[i][j] * board[i][j]);
}

if ( sum == 3 || sum == 12)
{
test = sum;
break;
}
sum = 0;
} // end of for loop

for ( j = 0; j < 3; j++)
{
sum = 0;
for ( i = 0; i < 3; i++)
{
sum += (board[i][j] * board[i][j]);
}

if ( sum == 3 || sum == 12)
{
test = sum;
break;
}

sum = 0;
} // end of for loop

if ( test != 3 || test != 12)
{

sum = (board[0][0] * board[0][0])+ (board[1][1] * board[1][1]) + (board[2][2] * board[2][2]);

if ( sum == 3 || sum == 12)
{
test = sum;

}
} // end of if condition

if (test != 3 || test != 12)
{

sum = (board[2][0] * board[2][0])+ (board[1][1] * board[1][1]) + (board[0][2] * board[0][2]);

if ( sum == 3 || sum == 12 )
{
test = sum;
}
} // end of if condition

// }

if ( test == 3)
{
test = 1;
}

else if ( test == 12)
{
test = 2;
}

else if ( count == 0)
{
test = 3;
}
else
{
test = 0;
}
return test;

} // end of Check_Board

void TicTacToe::Tic_Tac_Toe_Board()
{
for ( int row = 0; row < 3; row ++)
{

for ( int column = 0; column < 3; column++)
{

if ( board[row][column] == 0)
{
display_board[row][column] = ' ';
}
if ( board[row][column] == 1)
{
display_board[row][column] = 'X';
}
if ( board[row][column] == 2)
{
display_board[row][column] = 'O';
}
} // end of inner for loop
} // end of outer for loop

cout << " Let's Play Tic-Tac-Toe! " << endl;
cout << " Current Player: X Current Player: O " << endl;
cout << endl;
cout << " | | " << endl;
cout << " | | " << endl;
cout << display_board[0][0] << " | " << display_board[0][1] << " | " << display_board[0][2] << " " << endl;
cout << " | | " << endl;
cout << "-----------------------------------------------" << endl;
cout << " | | " << endl;
cout << " | | " << endl;
cout << display_board[1][0] << " | " << display_board[1][1] << " | " << display_board[1][2] << " " << endl;
cout << " | | " << endl;
cout << "-----------------------------------------------" << endl;
cout << " | | " << endl;
cout << display_board[2][0] << " | " << display_board[2][1] << " | " << display_board[2][2] << " " << endl;
cout << " | | " << endl;
cout << " | | " << endl;

} // end of Tic_Tac_Toe_Board




int main()
{


TicTacToe game;
bool test;
bool more = true;
int row = 0;
int column= 0;
int player;
int check = 0;


TicTacToe();

while ( more )
{
game.Tic_Tac_Toe_Board();
player = game.Pick_Player();


cout << " Current Player " << player;
cout << endl;
cout << " Enter Row Index ( 0,1,2): " ;
cout << endl;
cin >> row;
cout << " Enter Column Index (0,1,2): " << endl;
cin >> column;

game.Choice_of_Row(row);
game.Choice_of_Column(column);

test = game.Check_Move( game.Pick_Row(), game.Pick_Column());

if ( test == 1)
{

check = game.Check_Board();
}


else
{
while ( test == 0 )
{

cout << " Current Player " << game.Pick_Player() <<" Invalid Choice" << endl;

cout << " Enter Row Index ( 0,1,2): " ;

cin >> row;
cout << endl;
cout << " Enter Column Index ( 0,1,2): " ;

cin >> column;
cout << endl;
game.Choice_of_Row(row);
game.Choice_of_Column(column);

test = game.Check_Move(game.Pick_Row(),game.Pick_Column());
} // end of while loop
check = game.Check_Board();
}

if ( check == 1 || check == 2)
{
break;
}

else if ( check == 3 )
{
game.Tic_Tac_Toe_Board();
cout << " The game is tied. " << endl;

}

if ( player == 1)
{
player = 2;
}
else
{
player = 1;
}
game.Choice_by_Player(player);

} // end of outer while loop

game.Tic_Tac_Toe_Board();

cout << " Player " << check << " wins. " << endl;

return 0;
} // end of main function

Let's Play Tic-Tac-Toe!
Current Player: X Current Player: O

| |
| |
| |
| |
-----------------------------------------------
| |
| |
| |
| |
-----------------------------------------------
| |
| |
| |
| |
Current Player 1
Enter Row Index ( 0,1,2):
1
Enter Column Index (0,1,2):
1
Let's Play Tic-Tac-Toe!
Current Player: X Current Player: O

| |
| |
X | |
| |
-----------------------------------------------
| |
| |
| |
| |
-----------------------------------------------
| |
| |
| |
| |
Current Player 2
Enter Row Index ( 0,1,2):
2
Enter Column Index (0,1,2):
2
Space already used. Try Again.
Current Player 2 Invalid Choice
Enter Row Index ( 0,1,2): 1

Enter Column Index ( 0,1,2): 2

Space already used. Try Again.
Current Player 2 Invalid Choice
Enter Row Index ( 0,1,2): 00

Enter Column Index ( 0,1,2): 0

Space already used. Try Again.
Current Player 2 Invalid Choice
Enter Row Index ( 0,1,2):
answered by: Ayo
Add a comment
Know the answer?
Add Answer to:
TIC TAC TOE in openGL/ C++
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Can somebody help me with this coding the program allow 2 players play tic Tac Toe....

    Can somebody help me with this coding the program allow 2 players play tic Tac Toe. however, mine does not take a turn. after player 1 input the tow and column the program eliminated. I want this program run until find a winner. also can somebody add function 1 player vs computer mode as well? Thanks! >>>>>>>>>>>>>Main program >>>>>>>>>>>>>>>>>>>>>>> #include "myheader.h" int main() { const int NUM_ROWS = 3; const int NUM_COLS = 3; // Variables bool again; bool won;...

  • This is an advanced version of the game tic tac toe, where the player has to...

    This is an advanced version of the game tic tac toe, where the player has to get five in a row to win. The board is a 30 x 20. Add three more functions that will check for a win vertically, diagonally, and backwards diagonally. Add an AI that will play against the player, with random moves. Bound check each move to make sure it is in the array. Use this starter code to complete the assignment in C++. Write...

  • JAVA TIC TAC TOE - please help me correct my code Write a program that will...

    JAVA TIC TAC TOE - please help me correct my code Write a program that will allow two players to play a game of TIC TAC TOE. When the program starts, it will display a tic tac toe board as below |    1       |   2        |   3 |    4       |   5        |   6                 |    7      |   8        |   9 The program will assign X to Player 1, and O to Player    The program will ask Player 1, to...

  • In traditional Tic Tac Toe game, two players take turns to mark grids with noughts and...

    In traditional Tic Tac Toe game, two players take turns to mark grids with noughts and crosses on the 3 x 3 game board. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row in the game board wins the game. Super Tic Tac Toe game also has a 3 x 3 game board with super grid. Each super grid itself is a traditional Tic Tac Toe board. Winning a game of Tic...

  • You will create a PYTHON program for Tic-Tac-Toe game. Tic-Tac-Toe is normally played with two people....

    You will create a PYTHON program for Tic-Tac-Toe game. Tic-Tac-Toe is normally played with two people. One player is X and the other player is O. Players take turns placing their X or O. If a player gets three of his/her marks on the board in a row, column, or diagonal, he/she wins. When the board fills up with neither player winning, the game ends in a draw 1) Player 1 VS Player 2: Two players are playing the game...

  • The Code is C++ // tic tac toe game #include <iostream> using namespace std; const int SIZE = 9; int check(char *); void displayBoard(char *); void initBoard(char *); int main() {    char board[...

    The Code is C++ // tic tac toe game #include <iostream> using namespace std; const int SIZE = 9; int check(char *); void displayBoard(char *); void initBoard(char *); int main() {    char board[SIZE];    int player, choice, win, count;    char mark;    count = 0; // number of boxes marked till now    initBoard(board);       // start the game    player = 1; // default player    mark = 'X'; // default mark    do {        displayBoard(board);        cout << "Player " << player << "(" << mark...

  • Hi, I am a student in college who is trying to make a tic tac toe...

    Hi, I am a student in college who is trying to make a tic tac toe game on Java. Basically, we have to make our own game, even ones that already exist, on Java. We also have to implement an interface, that I have no idea exactly. The professor also stated we need at least 2 different data structures and algorithms for the code. The professor said we could use code online, we'd just have to make some of our...

  • java ****Please fix this tic tac toe coding error *****following is the error I've found difficult...

    java ****Please fix this tic tac toe coding error *****following is the error I've found difficult for me to fix. 1. Before I click the board, the grid doesn’t show up at all 2. It is not an automatic system.(if I click, it doesn’t move to next move) 3. if you click a button twice it shows o, x both 4. it is hard to close (you have to close the instruction) 5. instruction keep pops up (start->if you lose...

  • Q1) Write a C function that allows the user to initialize a Tic-Tac-Toe board. The board...

    Q1) Write a C function that allows the user to initialize a Tic-Tac-Toe board. The board is a 2D array of size 3x3. The function will set an id for each cell of the board starting from 1 and stop at 9. The function prototype is ​void​​ ​​InitializeBoard​​(​​int​​ m, ​​int​​ n , ​​char​​ board[][n]) void​​ ​​InitializeBoard​​(​​int​​ m, ​​int​​ n , ​​char​​ board[][n])​​{ ​​int​​ c =​​1​​; ​ for​​(​​int​​ i =​​0​​; i<m; i++){ ​​ for​​(​​int​​ j=​​0​​; j< n; j++){ board[i][j] = c+​​'0'​​;...

  • Tic-Tac-Toe Game Write a program that allows two players to play a game of tic-tac-toe. Use...

    Tic-Tac-Toe Game Write a program that allows two players to play a game of tic-tac-toe. Use a two-dimensional char array with three rows and three columns as the game board. Each element of the array should be initialized with an asterisk (*). The program should run a loop that does the following: Displays the contents of the board array. Allows player 1 to select a location on the board for an X. The program should ask the user to enter...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT