likeawizard / chess-go

Chess engine with lichess.org bot-play integration. Discontinued. Further development migrated to https://github.com/likeawizard/tofiks
2 stars 0 forks source link

Bug: engine crashes analyzing position #51

Closed likeawizard closed 2 years ago

likeawizard commented 2 years ago

at depth 5 the engine crashes with array index out of bounds error. Missing king returns position at 64

rnb1k2r/pp6/2ppqb2/4p2p/4P1p1/2NB1P2/PPPQ2PP/R3K1NR w KQkq - 2 14

likeawizard commented 2 years ago

The problem lies with double check detection code. The assumption that a double check must come from two different attack types is wrong as a pawn can promote with capture and reveal a rook attack resulting a double check of two rook attacks.