Strip output, fixing all AI problemes

This commit is contained in:
Malte Tammena 2017-10-19 13:52:08 +02:00
parent 5495b3e157
commit 6232484d63
2 changed files with 4 additions and 6 deletions

View file

@ -86,7 +86,6 @@ public class Game {
for (int i = 0; i < runs; i++) {
int result = new Game(p1, p2).start(false, true);
// TODO: Improve IDs
System.out.println(result);
statistic[result]++;
}
double[] percents = new double[3];

View file

@ -31,7 +31,6 @@ public class MalteAI implements Player{
}
Set<Integer> winningOptions = getWinningOptions(options, board);
for (Integer i: winningOptions) {
System.out.println(i);
return i.intValue();
}
@ -58,14 +57,14 @@ public class MalteAI implements Player{
new Item(0, 1, id),
new Item(0, 2, id),
new Item(0, 3, id)));
// for (Pattern p: patterns) {
// System.out.println(p);
// }
Set<Pattern> matches = Pattern.matchingPatterns(patterns, board);
Set<Integer> ret = new HashSet<>();
for (Pattern p: matches) {
Set<Position> positions = p.matches(board);
for (Item i: p.getZeros()) {
ret.add(new Integer(i.getPosX()));
for(Position pos: positions) {
ret.add(new Integer(i.getPosX() + pos.getPosX()));
}
}
}