Question: private static void computerMove ( ) { System.out.println ( Computer is calculating possibilities... ) ; for ( int i = 0 ; i <

private static void computerMove(){
System.out.println("Computer is calculating possibilities...");
for (int i =0; i <3; i++){
for (int j =0; j <3; j++){
if (board[i][j]==''){
board[i][j]= computer;
int score = minimaxHelper(2, false);
board[i][j]='';
System.out.println("Possibility for "+ i +","+ j +": Win "+((score ==1)?1 : 0)+", Loss "+((score ==-1)?1 : 0));
}
}
}
int[] bestMove = minimax(2, computer);
board[bestMove[0]][bestMove[1]]= computer;
System.out.println("Computer plays at: "+ bestMove[0]+","+ bestMove[1]);
} update this with : Win , Loss , Draw

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!