From 5fc7b793974ac18e36b3070e20da9253270c3fd3 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Fri, 3 Apr 2020 16:50:19 +0200 Subject: [PATCH] Only generate passing evasions in bikjang Avoid generating and filtering illegal passing moves. --- src/movegen.cpp | 4 ++-- src/position.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/movegen.cpp b/src/movegen.cpp index 11fe7c7..7c80fe3 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -494,8 +494,8 @@ ExtMove* generate(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(ksq, ksq); // Consider all evasion moves for special pieces diff --git a/src/position.h b/src/position.h index 8541111..c9c6087 100644 --- a/src/position.h +++ b/src/position.h @@ -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]++; -- 1.7.0.4