diff --git a/Makefile b/Makefile index d2cc181..09777c4 100644 --- a/Makefile +++ b/Makefile @@ -25,4 +25,4 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/types.h | $(OBJ_DIR) # Create the object directory if it doesn't exist $(OBJ_DIR): - mkdir -p $@ + mkdir $@ diff --git a/source/bitboards.cpp b/source/bitboards.cpp index 748f72c..9a23c3a 100644 --- a/source/bitboards.cpp +++ b/source/bitboards.cpp @@ -30,6 +30,12 @@ void Bitboard::SetBit(int square) { m_board |= (1ULL << square); } +void Bitboard::PopBit(int square) { + if (Bitboard(m_board).IsSet(square)) { + m_board &= (~Bitboard::GetSquare(square)).GetBoard(); + } +} + int Bitboard::popCount() const { U64 board = m_board; int count = 0; @@ -76,9 +82,6 @@ Bitboard Bitboard::operator|=(const Bitboard& other) { Bitboard Bitboard::operator^=(const Bitboard& other) { return m_board ^= other.m_board; } -Bitboard Bitboard::operator*=(const Bitboard& other) { - return m_board *= other.m_board; -} Bitboard Bitboard::operator<<(int other) { if (other > 0) { diff --git a/source/bitboards.h b/source/bitboards.h index 5c303a6..3e7ec7b 100644 --- a/source/bitboards.h +++ b/source/bitboards.h @@ -15,6 +15,7 @@ public: U64 GetBoard() const; bool IsSet(int square) const; void SetBit(int square); + void PopBit(int square); void PrintBoard() const; int popCount() const; @@ -32,7 +33,6 @@ public: Bitboard operator&=(const Bitboard& other); Bitboard operator|=(const Bitboard& other); Bitboard operator^=(const Bitboard& other); - Bitboard operator*=(const Bitboard& other); Bitboard operator<<(int other); Bitboard operator>>(int other); diff --git a/source/types.h b/source/types.h index 1d5062b..d513720 100644 --- a/source/types.h +++ b/source/types.h @@ -4,7 +4,7 @@ using U64 = uint64_t; -constexpr char StartingFen[] = "8/1BR1P1P1/2Q1p3/1P2P2p/3B1K2/3k4/3p2pP/4n3 w - - 0 1"; +constexpr char StartingFen[] = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR"; enum COLOR { White,