diff --git a/Others/MiniMaxAlgorithm.java b/Others/MiniMaxAlgorithm.java index 06bfa732c281..7d0dd0537f6f 100644 --- a/Others/MiniMaxAlgorithm.java +++ b/Others/MiniMaxAlgorithm.java @@ -97,8 +97,8 @@ public static int[] getRandomScores(int size, int maxScore) { int[] randomScores = new int[(int) Math.pow(2, size)]; Random rand = new Random(); - for (int a : randomScores) { - a = rand.nextInt(maxScore) + 1; + for (int i = 0; i < randomScores.length; i++) { + randomScores[i] = rand.nextInt(maxScore) + 1; } return randomScores;