Unfree Pawns (Bitboards)

From Chessprogramming wiki
Jump to: navigation, search

Home * Board Representation * Bitboards * Pawn Pattern and Properties * Unfree Pawns

Unfree Pawns, (Closed Pawns) are pawns with a mechanical obstruction of an opponent pawn in front. Being an unfree pawn is therefore a mutual property for both white and black pawns on a closed file. Even if weak, like isolated or backward, unfree pawns are considered less vulnerable than open pawns on a halfopen file. Thus, in the initial position all pawns are unfree.

Unfree Single Pawn

Working in the square centric world of the board, thus using a square index of one particular pawn, likely from bitboard traversal, to lookup pre-calculated pattern.

For a single pawn we need to access a lookup-table to get all squares on the same file in front of the pawn. If the intersection of the frontspan with the set of opponent pawns is not empty, it is an unfree or closed pawn.

U64 arrFrontSpans[2][64];

if ( (arrFrontSpans[white][sqOfWhitePawn] & pawnBB[black]) != 0 ) -> pawn unfree
arrFrontSpan[white][d4]
. . . 1 . . . .
. . . 1 . . . .
. . . 1 . . . .
. . . 1 . . . .
. . . p . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .

Unfree Pawns set-wise

Working in the bitboard centric world to determine pawn related pattern set-wise.

Unfree (or closed) Pawns have a mechanical obstruction in front - an opponent pawn as member of the own frontfill or frontspan. An intersection with opponents frontspans is sufficient to determine unfree pawns:

U64 wUnfreePawns(U64 wpawns, U64 bpawns) {
   return wpawns & bFrontSpan(bpawns);
}

U64 bUnfreePawns(U64 bpawns, U64 wpawns) {
   return bpawns & wFrontSpan(wpawns);
}

External Links

See also

References

  1. Hans Kmoch (1959, 1990). Pawn Power in Chess. New York: Dover, 1990. Previous ed.: New York: McKay, 1959

Up one Level