Compare commits
3 Commits
0d7f030634
...
a4d5dbbc84
Author | SHA1 | Date | |
---|---|---|---|
a4d5dbbc84 | |||
b819e27f55 | |||
9552678efe |
@@ -143,7 +143,11 @@ void Board::handlePawnDoubleAdvance(const Move &move, BitBoard bb, const Piece &
|
||||
}
|
||||
|
||||
void Board::pseudoLegalMoves(MoveVec &moves) const {
|
||||
(void) moves;
|
||||
auto occupied = mOccupiedBB;
|
||||
while(occupied) {
|
||||
auto to = Square(occupied.pop());
|
||||
pseudoLegalMovesFrom(to, moves);
|
||||
}
|
||||
}
|
||||
|
||||
void Board::pseudoLegalMovesFrom(const Square &from, Board::MoveVec &moves) const {
|
||||
|
@@ -24,6 +24,10 @@ else ()
|
||||
add_compile_options(-Wall -Wextra -pedantic -Werror)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
add_compile_options(-O3 -march=native)
|
||||
endif()
|
||||
|
||||
add_library(cplchess_lib OBJECT
|
||||
Square.cpp
|
||||
Move.cpp
|
||||
|
@@ -1,4 +1,3 @@
|
||||
#include <iostream>
|
||||
#include "MoveGenerator.hpp"
|
||||
#include "Board.hpp"
|
||||
#include "BoardState.hpp"
|
||||
@@ -77,13 +76,9 @@ void MoveGenerator::generateKingMoves(const BoardState &bs, const Square &from,
|
||||
BitBoard target = CastlingRanks | bs.occupiedBB;
|
||||
auto attacked = generateAttackedSquares(bs, target, !bs.turn);
|
||||
|
||||
std::cout << "attacked\n" << attacked;
|
||||
|
||||
movesBB |= BitBoard::castlingMoves(fromBB & ~attacked,
|
||||
(*bs.pieceBBs)[Board::toIndex(PieceType::Rook)],
|
||||
~bs.occupiedBB)
|
||||
& castlingRank;
|
||||
std::cout << "moves\n" << movesBB;
|
||||
~bs.occupiedBB) & castlingRank;
|
||||
|
||||
if ((checkCR & CastlingRights::KingSide) == CastlingRights::None) {
|
||||
movesBB &= ~GFile;
|
||||
|
Reference in New Issue
Block a user