# Avoiding Rotated Bitboards with Direct Lookup

**Authors:** Sam Tannous

arXiv: 0704.3773 · 2007-10-09

## TL;DR

This paper introduces a method to directly access attacked squares of sliding pieces in chess using hash tables, eliminating the need for rotated bitboards and simplifying move generation.

## Contribution

The paper presents a novel hash table-based approach for attack detection that avoids the complexity of rotated bitboards in chess engines.

## Key findings

- Direct hash table lookup is faster than rotated bitboard methods.
- The approach simplifies move generation by removing the need for rotated bitboard updates.
- Performance benchmarks show improved speed in move generation.

## Abstract

This paper describes an approach for obtaining direct access to the attacked squares of sliding pieces without resorting to rotated bitboards. The technique involves creating four hash tables using the built in hash arrays from an interpreted, high level language. The rank, file, and diagonal occupancy are first isolated by masking the desired portion of the board. The attacked squares are then directly retrieved from the hash tables. Maintaining incrementally updated rotated bitboards becomes unnecessary as does all the updating, mapping and shifting required to access the attacked squares. Finally, rotated bitboard move generation speed is compared with that of the direct hash table lookup method.

## Full text

Tomesphere does not host the full text of arXiv papers. Read it on arXiv: https://arxiv.org/abs/0704.3773

## References

14 references — full list in the complete paper: https://tomesphere.com/paper/0704.3773/full.md

---
Source: https://tomesphere.com/paper/0704.3773