Browse Source

Now sorting via deviation from middle column

Vsevolod Levitan 4 tháng trước cách đây
mục cha
commit
590aab97a1
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      MinMaxABFourInARowBoard.cs

+ 1 - 1
MinMaxABFourInARowBoard.cs

@@ -199,6 +199,6 @@ public class MinMaxABFourInARowBoard
             moves.Add((i, EvaluateMinMax(newBoard, depth)));
         });
 
-        return moves.MaxBy(m => m.Score).Column;
+        return moves.OrderByDescending(m => m.Score).ThenByDescending(m => int.Abs(m.Column - (board.dimensions.Columns / 2))).First().Column;
     }
 }