}
}
fn genKnightAttacks() [@typeInfo(Square).Enum.fields.len]BoardType {
var ret: [64]BoardType = [_]BoardType{0} ** 64;
var bb: BitBoard = .{};
for (std.enums.values(Square)) |square| {
bb.board = 0;
bb.set(square);
// upward
if (bb.board & Square.fileBits('a') == 0)
ret[@enumToInt(square)] |= bb.board >> 17;
if (bb.board & Square.fileBits('h') == 0)
ret[@enumToInt(square)] |= bb.board >> 15;
if (bb.board & (Square.fileBits('a') | Square.fileBits('b')) == 0)
ret[@enumToInt(square)] |= bb.board >> 10;
if (bb.board & (Square.fileBits('h') | Square.fileBits('g')) == 0)
ret[@enumToInt(square)] |= bb.board >> 6;
// downward
if (bb.board & Square.fileBits('h') == 0)
ret[@enumToInt(square)] |= bb.board << 17;
if (bb.board & Square.fileBits('a') == 0)
ret[@enumToInt(square)] |= bb.board << 15;
if (bb.board & (Square.fileBits('h') | Square.fileBits('g')) == 0)
ret[@enumToInt(square)] |= bb.board << 10;
if (bb.board & (Square.fileBits('a') | Square.fileBits('b')) == 0)
ret[@enumToInt(square)] |= bb.board << 6;