Only generate passing evasions in bikjang
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 3 Apr 2020 14:50:19 +0000 (16:50 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 3 Apr 2020 14:50:19 +0000 (16:50 +0200)
Avoid generating and filtering illegal passing moves.

src/movegen.cpp
src/position.h

index 11fe7c7..7c80fe3 100644 (file)
@@ -494,8 +494,8 @@ ExtMove* generate<EVASIONS>(const Position& pos, ExtMove* moveList) {
   Bitboard sliderAttacks = 0;
   Bitboard sliders = pos.checkers();
 
-  // Passing move by king
-  if (pos.king_pass())
+  // Passing move by king in bikjang
+  if (pos.bikjang() && pos.king_pass())
       *moveList++ = make<SPECIAL>(ksq, ksq);
 
   // Consider all evasion moves for special pieces
index 8541111..c9c6087 100644 (file)
@@ -168,6 +168,7 @@ public:
   // Variant-specific properties
   int count_in_hand(Color c, PieceType pt) const;
   int count_with_hand(Color c, PieceType pt) const;
+  bool bikjang() const;
 
   // Position representation
   Bitboard pieces() const;
@@ -1022,6 +1023,10 @@ inline int Position::count_with_hand(Color c, PieceType pt) const {
   return pieceCount[make_piece(c, pt)] + pieceCountInHand[c][pt];
 }
 
+inline bool Position::bikjang() const {
+  return st->bikjang;
+}
+
 inline void Position::add_to_hand(Piece pc) {
   pieceCountInHand[color_of(pc)][type_of(pc)]++;
   pieceCountInHand[color_of(pc)][ALL_PIECES]++;