A simple method to check if a move delivers checks.

Discussion of chess software programming and technical issues.

Moderator: Ras

OliverBr
Posts: 846
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: A simple method to check if a move delivers checks.

Post by OliverBr »

abulmo2 wrote: Fri Sep 19, 2025 11:40 pm
OliverBr wrote: Thu Sep 18, 2025 1:41 pm Have I missed something?
Castling ? This is the only king move that can give a direct chess, through the rook actually.
Nice one! As Castling is a "King-move" in OliThink also I would have missed this.
OliThink GitHub: https://github.com/olithink
Nice arcticle about OlIThink: https://www.chessengeria.eu/post/olithink-oldie-goldie
Chess Engine OliThink Homepage: http://brausch.org/home/chess
OliverBr
Posts: 846
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: A simple method to check if a move delivers checks.

Post by OliverBr »

chessbit wrote: Fri Sep 19, 2025 6:47 pm Also, the way you access data with arrays etc is quite inefficient, but since I don't know your code and what you're trying to achieve, I will ignore that.
Do you mean, by e.g.

Code: Select all

BIT[t]
instead of

Code: Select all

1LL << t
?

Easily explained: I tested it thoroughly with millions of games and BIT[t] was a little faster.
My explanation: BIT[64] (or nmoves[64]) are small arrays and fit easily in any level x cache. Maybe I am wrong, but this was my reasoning.
OliThink GitHub: https://github.com/olithink
Nice arcticle about OlIThink: https://www.chessengeria.eu/post/olithink-oldie-goldie
Chess Engine OliThink Homepage: http://brausch.org/home/chess