From b0ed66a78648465a8bdb7962b110ef05f505f29d Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Thu, 19 Oct 2017 13:52:08 +0200 Subject: [PATCH] Strip output, fixing all AI problemes --- src/game/Game.java | 1 - src/player/malte/MalteAI.java | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/game/Game.java b/src/game/Game.java index a337b8e..d019bbc 100644 --- a/src/game/Game.java +++ b/src/game/Game.java @@ -89,7 +89,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]; diff --git a/src/player/malte/MalteAI.java b/src/player/malte/MalteAI.java index d8dd97e..404dd81 100644 --- a/src/player/malte/MalteAI.java +++ b/src/player/malte/MalteAI.java @@ -36,7 +36,6 @@ public class MalteAI implements Player{ } Set winningOptions = getWinningOptions(options, board); for (Integer i: winningOptions) { - System.out.println(i); return i.intValue(); } @@ -63,14 +62,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 matches = Pattern.matchingPatterns(patterns, board); Set ret = new HashSet<>(); for (Pattern p: matches) { + Set 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())); + } } }