From 60d6668408319e4991c1a27d9e8f43faf7b87909 Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Mon, 23 Oct 2017 15:16:15 +0200 Subject: [PATCH] Added sequence moves --- src/player/malte/MalteAI.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/player/malte/MalteAI.java b/src/player/malte/MalteAI.java index 311efa2..f3bac1d 100644 --- a/src/player/malte/MalteAI.java +++ b/src/player/malte/MalteAI.java @@ -137,10 +137,13 @@ public class MalteAI implements Player{ weight *= W_WIN; } } - // Prevent choosing a bad spot Sequence xA = sequencesAbove[i]; - if (sequencesAbove[i].matches("EEE")) { + if (xA.matches("EEE")) { + // Prevent choosing a bad spot weight *= W_DONT; + } else if (xA.matches("MMM")) { + // Open the opportunity + weight *= W_WIN; } } return weight;