AI improvements

This commit is contained in:
Malte Tammena 2017-10-20 09:12:16 +02:00 committed by Maurizio Bruetsch
parent 9769fc0c6d
commit 2e9347cfb3
2 changed files with 3 additions and 3 deletions

View file

@ -37,7 +37,6 @@ public class MalteAI implements Player{
}
Set<Integer> winningOptions = getRowCompletionOptions(options, board, id);
for (Integer i: winningOptions) {
System.out.println("WINNING");
return i.intValue();
}
@ -45,12 +44,10 @@ public class MalteAI implements Player{
for (Integer i: preventionsOptions) {
int[][] fakeBoard = makeMove(copyBoard(board), i, id);
if (getRowCompletionOptions(options, fakeBoard, enemyID).size() == 0) {
System.out.println("PREVENTING");
return i.intValue();
}
}
System.out.println("RANDOM");
return takeRandom(options).intValue();
}

View file

@ -6,6 +6,9 @@ import java.util.Arrays;
import game.Game;
/**
* A Connect Four Pattern.
*/
public class Pattern {
private Set<Item> parts;