From Chessprogramming wiki
Jump to: navigation, search

Home * Chess * Squares * Occupancy

Occupied [1]

The Occupancy refers to the boolean property of a square. It is occupied if any piece exclusively resides on that square, otherwise the square is empty. In bitboards, the occupancy or occupied bitboard refers the set of all squares occupied by any piece. Thus, it is the union of all piece bitboards, which is used for instance in calculating sliding piece attacks. Likely, while the piece bitboards are updated incrementally, the occupancy is updated incrementally as well, rather than calculated from up to 12 piece bitboards each time.

Alternatively, if needed more often, the complement set of the occupancy, the set of all empty squares is exclusively kept inside the board-definition and a cheap not-instruction is done to calculate the occupancy on the fly. Other programs keep disjoint white and black pieces, to "or" them if the occupancy is actually needed. The appearance of multiple, redundant occupied bitboards, which are flipped, mirrored or rotated are eponym of bitboard methods related to sliding piece attack generation, most notably rotated and reverse bitboards.

See also

Obstruction Difference
Occupancy of any Line
Reverse Bitboards
Rotated Bitboards

Forum Posts

External Links


  1. Besetzt! (Occupied) - Toilet exhibition at Umspannwerk Recklinghausen, today RWE Technology museum in Recklinghausen, Germany, and part of The Industrial Heritage Trail of the Ruhr area - Portable toilet labeled Rock:Klo with Frank Zappa Toilet Poster inside, Photo by Gerd Isenberg, September 16, 2016

Up one Level