That's wrong. The rook attacks a1 _and_ h1. And if an enemy piece is on either, the rook can move to that square and capture it.
For any single square, there are 32 different possible sets of squares that are attacked. The square the piece sits on is not attacked. The two adjacent squares are ...
Search found 6 matches
- Fri May 06, 2011 6:13 pm
- Forum: Programming and Technical Discussions
- Topic: A question on rotated bitboard
- Replies: 11
- Views: 5900
- Thu May 05, 2011 6:47 am
- Forum: Programming and Technical Discussions
- Topic: A question on rotated bitboard
- Replies: 11
- Views: 5900
Re: A question on rotated bitboard
Hi Hyatt,
I don't quite follow your "they will be the same for..." If you put a sliding piece on any one of the 64 square, you have 64 different attack patterns, one for each square. But since the pieces slide, you need that [256] for rooks (actually you can reduce this to 64 since the endpoint on ...
I don't quite follow your "they will be the same for..." If you put a sliding piece on any one of the 64 square, you have 64 different attack patterns, one for each square. But since the pieces slide, you need that [256] for rooks (actually you can reduce this to 64 since the endpoint on ...
- Wed May 04, 2011 12:26 pm
- Forum: Programming and Technical Discussions
- Topic: A question on rotated bitboard
- Replies: 11
- Views: 5900
Re: A question on rotated bitboard
I think I got the point, In the example above for the rank state "10000010", if we swap the rook and the other piece, the state remains the same and hence the attack set for the rook swapped to g1 would be wrong. So we need a way to distinguish where the rook is and hence there has to be 64*8 states ...
- Wed May 04, 2011 11:43 am
- Forum: Programming and Technical Discussions
- Topic: A question on rotated bitboard
- Replies: 11
- Views: 5900
Re: A question on rotated bitboard
a1 vs a5 can be distinguished by shifting the result back
Agreed. This is what I need to ensure.
but a1 vs e1 are different attack sets for each occupancy set. the opposite is of course the case for file_attacks.
Can't that be distinguished as one of the 64 states..
Suppose the rook is on a1 ...
Agreed. This is what I need to ensure.
but a1 vs e1 are different attack sets for each occupancy set. the opposite is of course the case for file_attacks.
Can't that be distinguished as one of the 64 states..
Suppose the rook is on a1 ...
- Wed May 04, 2011 9:58 am
- Forum: Programming and Technical Discussions
- Topic: A question on rotated bitboard
- Replies: 11
- Views: 5900
Re: A question on rotated bitboard
If size of tables really concerns you, you can reduce the 256 to 64 though because the outer bits don't matter in the occupied state (there's no square behind them to block). Just shift by 1 bit further to take off the low bit, and mask off the high bit when building your occupancy byte.
Thanks ...
Thanks ...
- Wed May 04, 2011 8:08 am
- Forum: Programming and Technical Discussions
- Topic: A question on rotated bitboard
- Replies: 11
- Views: 5900
A question on rotated bitboard
Hi All,
I am a novice chess programmer started to build a simple chess engine based on bitboards. This query is regarding the rotated bitboard. In almost all the internet pages, I see that we need to have a lookup table represented as rank_attacks[64][256], file_attacks[64][256] for caching the ...
I am a novice chess programmer started to build a simple chess engine based on bitboards. This query is regarding the rotated bitboard. In almost all the internet pages, I see that we need to have a lookup table represented as rank_attacks[64][256], file_attacks[64][256] for caching the ...