]> git.sesse.net Git - stockfish/commitdiff
Add a known draw case in kpk bitbase generation
authorMarco Costalba <mcostalba@gmail.com>
Sat, 19 May 2012 07:38:23 +0000 (08:38 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 19 May 2012 07:45:16 +0000 (08:45 +0100)
Early classify as known draws the positions
where white king is trapped on the rook file.

Suggested by Dan Honeycutt.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/bitbase.cpp

index b01a03d4bc8815ea3c20794057dfc1b3cde159c5..ceb94a0f9ef002f7c5bcc6218c8bf5a09df47b7a 100644 (file)
@@ -156,7 +156,7 @@ namespace {
         && rank_of(psq) < RANK_7)
         return DRAW;
 
-    //  Case 4: White king in front of pawn and black has opposition
+    // Case 4: White king in front of pawn and black has opposition
     if (   stm == WHITE
         && wksq == psq + DELTA_N
         && bksq == wksq + DELTA_N + DELTA_N
@@ -168,6 +168,13 @@ namespace {
         && file_of(psq) == FILE_A)
         return DRAW;
 
+    // Case 6: White king trapped on the rook file
+    if (   file_of(wksq) == FILE_A
+        && file_of(psq) == FILE_A
+        && rank_of(wksq) > rank_of(psq)
+        && bksq == wksq + 2)
+        return DRAW;
+
     return UNKNOWN;
   }