Question: / / Initialise bestScore for each player int bestScore; if ( player = = 1 ) / / the AI plays to maximise scores bestScore

// Initialise bestScore for each player
int bestScore;
if (player ==1)// the AI plays to maximise scores
bestScore =-1;
else // the Human plays to minimise the AI's scores
bestScore =1;
// The terminal tests call helper functions elsewhere in the code (not included here)
if(AIhasWon())
return 1;
else if(humanHasWon())
return -1 ;
// If neither player has won, determine successor states and simulate Minimax gameplay
ArrayListi=0i
 // Initialise bestScore for each player int bestScore; if (player ==1)//

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!