public int [ ] [ ] minimax ( ( char player ) { ) { int [
Fantastic news! We've Found the answer you've been seeking!
Question:
public int[] minimax(char player){
int[] bestMove = new int[]{−1,−1};
int bestScore = Integer.MIN_VALUE; // Or Zero.no problem.
for (int i =0; i < emptyCells().size(); i++){
Cell cell = emptyCells().get(i);
cell.value = player;
int score = findMinOrMaxScore(false);
cell.value = ' ' " id="MathJax-Element-24-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">='';
if ((player = = ' " id="MathJax-Element-26-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">=='O' " id="MathJax-Element-27-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">' && score > bestScore)||(player = = ' " id="MathJax-Element-30-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">=='X' " id="MathJax-Element-31-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">' && score < bestScore)){
bestScore = score;
bestMove[0]= cell.row;
bestMove[1]= cell.column;
}
} Whats the wrong in this code ?
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date: