Duo+Trio+Quart+(Bitboards)

toc
 * Home * Board Representation * Bitboards * Pawn Pattern and Properties * Duo Trio Quart**

two adjacent pawns of the same color on the same rank that mutually cover the other's stop square. A **Trio** are three horizontal friendly pawns, a **Quart** four horizontal friendly pawns.
 * Pawn-Duo**, (Phalanx)

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

//The code snippets rely on shifting bitboards, specially by one step only.//

=Neighbors= To get pawns with east or west neighbors is simple: code format="cpp" U64 pawnsWithEastNeighbors(U64 pawns) { return pawns & westOne (pawns); }

U64 pawnsWithWestNeighbors(U64 pawns) { return pawnsWithEastNeighbors(pawns) << 1; // * 2 } code or code format="cpp" U64 pawnsWithWestNeighbors(U64 pawns) { return pawns & eastOne (pawns); }

U64 pawnsWithEastNeighbors(U64 pawns) { return pawnsWithWestNeighbors(pawns) >> 1; } code

code pawns              pawns with east     pawns with west     pawns with east neighbors          neighbors           and west neighbors . . . . . . . .    . . . . . . . .     . . . . . . . .     . . . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . 1 1 1 . . . . .     1 1 . . . . . .     . 1 1 . . . . .     . 1 . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . . . . . . 1 1 .     . . . . . 1 . .     . . . . . . 1 .     . . . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . code =Neighbor Algebra= Pawns with east or west neighbors are at least member of a duo. Pawns with east and west neighbors at least member of a trio. If two neighbors have both east and west neighbors, it is at least a quart.

An exclusive pawn duo is therefor a pawn with one neighbor, while this neighbor has no other neighbor as well. code format="cpp" U64 duo (U64 pawns) { U64 withWestNeighbors = pawnsWithWestNeighbors(pawns); U64 withEastNeighbors = withWestNeighbors >> 1;

U64 withOneExclusiveNeighbor = withWestNeighbors ^ withEastNeighbors; U64 withExclusiveWestNeighbor = withWestNeighbors & withOneExclusiveNeighbor; U64 withExclusiveEastNeighbor = withEastNeighbors & withOneExclusiveNeighbor;

U64 duoWestOne = withEclusiveEastNeighbor & (withEclusiveWestNeighbor >> 1); U64 duoEastOne = duoWestOne << 1; return duoWestOne | duoEastOne; } code

code pawns              pawns with excl. pawns with excl. duo east neighbor      west neighbor . . . . . . . .    . . . . . . . .     . . . . . . . .     . . . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . 1 1 1 . . . . .     1 . . . . . . .     . . 1 . . . . .     . . . . . . . . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . . . . . . 1 1 .     . . . . . 1 . .     . . . . . . 1 .     . . . . . 1 1 . . . . . . . . .     . . . . . . . .     . . . . . . . .     . . . . . . . . code =See also=
 * Stop Square
 * Hanging Pawns
 * Pawn Islands (Bitboards)
 * Phalanx (Engine)

=Forum Posts=
 * [|The phalanx concept] by Lyudmil Tsvetkov, CCC, May 21, 2014

=External Links= > Kinga Głyk, [|Irek Głyk], [|Rafal Stepien] > media type="youtube" key="Xmq52kc_HM0" > media type="youtube" key="xDiKq9Wf0UQ"
 * [|Pawn Structure (General) | Page 5 of 5 | Phalanx Formation]
 * [|Duet from Wikipedia]
 * [|Phalanx from Wikipedia]
 * [|Trio from Wikipedia]
 * [|Kinga Głyk Trio] - Walking Baby, [|VisionInMusica], [|Terni], March 10, 2017, [|YouTube] Video
 * [|Quart (disambiguation) from Wikipedia]
 * Panta Rhei plays [|Bartók's] Quarts, 1977, [|YouTube] Video

=References= =What links here?= include page="Duo Trio Quart (Bitboards)" component="backlinks" limit="20"
 * Up one Level**