AI changes.

This commit is contained in:
Malte Tammena 2017-10-17 12:32:06 +02:00
parent 3a7b86a1ff
commit 361fe5920a

View file

@ -3,6 +3,7 @@ package player;
import java.util.Random; import java.util.Random;
import java.util.Set; import java.util.Set;
import java.util.HashSet; import java.util.HashSet;
import java.util.Arrays;
public class MalteAI implements Player{ public class MalteAI implements Player{
@ -15,7 +16,7 @@ public class MalteAI implements Player{
} }
public int move(int[][] board){ public int move(int[][] board){
Set<Integer> options = new HashSet<>([0, 1, 2, 3, 4, 5, 6]); Set<Integer> options = new HashSet<Integer>(Arrays.asList(0,1,2,3,4,5,6));
for (Integer i: options) { for (Integer i: options) {
if (board[i][0] != 0) { if (board[i][0] != 0) {
options.remove(i); options.remove(i);