You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The magic bitboard attacks are initialized in a undefined way that movegen::SQUARES_BETWEEN_BB is completely wrong (only if it's generated at runtime, which by default yes).
Reproduce code:
#include "attacks.h"
using namespace chess;
int _(){
assert(attacks::bishop(SQ_A1, 0)==9241421688590303744ULL&&"Well... this is a debug message, but this is a landmine that the magic bitboards are NOT initialized before this, wontwork\n");
return 0;
}
int _main=_();
int main(){ return _main; }
Output:
PS C:\Users\winapiadmin\source\repos\chesslib\build> .\a.exe
Assertion failed: attacks::bishop(SQ_A1, 0)==9241421688590303744ULL&&"Well... this is a debug message, but this is a landmine that the magic bitboards are NOT initialized before this, wontwork\n", file .\test.cpp, line 4
P/S: This depends on link order. The PR #28 works because I put the movegen.cpp after attacks.cpp; therefore, it links attacks.o(bj) before movegen.o(bj)
Activity
feat(moves): add support for SAN notation parsing and generation