libscid snapshot+1833ab5ad39d
Chess applications made easy.
Source on GitHub License GPL v2
Loading...
Searching...
No Matches
attacks.h File Reference

Precomputed king and knight attack tables. More...

+ Include dependency graph for attacks.h:

Go to the source code of this file.

Namespaces

namespace  scid
 Public namespace for libscid.
 
namespace  scid::core
 Chess games, positions, movetext and notation.
 

Variables

const squareT scid::core::knightAttacks [66][9]
 Knight attack targets for each square, terminated by NULL_SQUARE.
 
const squareT scid::core::kingAttacks [66][9]
 King attack targets for each square, excluding castling, terminated by NULL_SQUARE.
 

Detailed Description

Precomputed king and knight attack tables.

Each attack list has room for eight legal targets plus a NULL_SQUARE terminator. The COLOR_SQUARE and NULL_SQUARE sentinel rows contain only NULL_SQUARE values, so callers can iterate without first testing whether the source square is a normal board square.