Strip output, fixing all AI problemes

This commit is contained in:
Malte Tammena 2017-10-19 13:52:08 +02:00 committed by Maurizio Bruetsch
parent 318792c9b0
commit b0ed66a786
2 changed files with 4 additions and 6 deletions

View file

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

View file

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