/*
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package dk.ekot.ibm.Jan2021;

import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;

import java.util.List;
import java.util.Locale;

/**
 *
 */
class Match {
    public final String nature;
    public final int width;
    public final int height;
    public final int moves;
    public final long spendTimeMS;
    public final String visualGrid;
    public final List<Pos> antis;

    public Match(String nature, int width, int height, int moves, long spendTimeMS, String visualGrid, int[] antis) {
        this(nature, width, height, moves, spendTimeMS, visualGrid, Pos.toPosList(antis, width, height));
    }
    public Match(String nature, int width, int height, int moves, long spendTimeMS, String visualGrid, List<Pos> antis) {
        this.nature = nature;
        this.width = width;
        this.height = height;
        this.moves = moves;
        this.spendTimeMS = spendTimeMS;
        this.visualGrid = visualGrid;
        this.antis = antis;
    }

    public String toString() {
        return String.format(
                Locale.ENGLISH, "%s(%3d, %3d) moves=%6d, ms=%6d, antis=%d: %s",
                nature, width, height, moves, spendTimeMS, antis.size(), antis);

    }
}

@@ -601,94 +601,8 @@
 1;%0A%0A
-import org.apache.commons.logging.LogFactory;%0Aimport org.apache.commons.logging.Log;%0A%0A
 impo
@@ -756,24 +756,53 @@
 int height;%0A
+    public final int startY;%0A
     public f
@@ -1033,24 +1033,36 @@
  int%5B%5D antis
+, int startY
 ) %7B%0A        
@@ -1156,16 +1156,24 @@
  height)
+, startY
 );%0A    %7D
@@ -1291,16 +1291,28 @@
 s%3E antis
+, int startY
 ) %7B%0A    
@@ -1391,24 +1391,54 @@
 t = height;%0A
+        this.startY = startY;%0A
         this
@@ -1593,24 +1593,231 @@
 oString() %7B%0A
+        boolean matchOnStartY = false;%0A        for (Pos anti: antis) %7B%0A            if (anti.y == startY && anti.x == 0) %7B%0A                matchOnStartY = true;%0A                break;%0A            %7D%0A        %7D%0A
         retu
@@ -1885,36 +1885,38 @@
 d) m
-ove
 s=%256d, 
-ms=%256d, antis
+antis=%25d: %25s, startY
 =%25d
-: 
 %25s%22,
@@ -1946,39 +1946,32 @@
 , width, height,
- moves,
  spendTimeMS, an
@@ -1987,16 +1987,51 @@
 ), antis
+, startY, matchOnStartY ? %22%22 : %22 *%22
 );%0A%0A    

Add startY