Pawn+Islands+(Bitboards)

toc =Sample Filesets= Black has three islands here, white two: code . . . . . . . . b. . . . . . b . b. b b. b. . . . . . . . . . . . . . . . . . w. . . w. . w. w. . . w w .. . . . . . . code Those are the black and white filesets, one byte each. code b b. b b. b b
 * Home * Board Representation * Bitboards * Pawn Pattern and Properties * Pawn Islands**
 * [[image:Drowned.jpg width="176" height="240" link="http://www.chgs.umn.edu/museum/responses/bak/chess.html"]] ||~  || **Pawn islands** of either side are groups of pawns (at least one), separated by files without own pawns. Those files are therefor either halfopen or open. All other things being equal, the side with fewer pawn islands has an advantage, because the individual pawns are easier to defend against enemy attacks. Each island has a west- or east border file. Rook-files may be the most outer borders. ||
 * Samuel Bak - Drowned ||~  ||^   ||

w w w. . w w w code

=Island Borders= Based on filesets, we can simply determine the west- or east border-files of each island. By shifting left or right one, xor with the original fileset to get all the 0-1 or 1-0 transitions - to finally intersect it with the original fileset to restrict the transitions inside this set of occupied files. The result are the files with half-isolanis.

Since conjunction is distributive over xor, one may alternately swap both operands. In fact it is the relative complement of the shifted files in files and takes three operations each.

East
code b b. b b. b b . b. . b. . b

w w w. . w w w .. w. . . . w code

code format="cpp" BYTE islandsEastFiles(BYTE f) {return f & (f ^ (f >> 1));} BYTE islandsEastFiles(BYTE f) {return f ^ (f & (f >> 1));} BYTE islandsEastFiles(BYTE f) {return f &    ~(f >> 1) ;} code

code 1 . . . 1 1 . . files . . . 1 1 . . . files >> 1 (board left or west) 1 . . 1 . 1 . . xor       -> all the west 0-1 or 1-0 file-transitions 1 . . . . 1 . . and files -> east files of each island code

West
code b b. b b. b b b. . b. . b.

w w w. . w w w w. . . . w. . code

code format="cpp" BYTE islandsWestFiles(BYTE f) {return f & (f ^ (f << 1));} // ... (f+f) BYTE islandsWestFiles(BYTE f) {return f ^ (f & (f << 1));} BYTE islandsWestFiles(BYTE f) {return f &    ~(f << 1) ;} code

code 1 . . . 1 1 . . files . 1 . . . 1 1 . files << 1  (board right or east) 1 1 . . 1 . 1 . xor       -> all the east 0-1 or 1-0 file-transitions 1 . . . 1 . . . and files -> west files of each island code

=Number of Islands= Since each island has exactly one west- and one east border-file, the population count of either border-set might be used to determine the numbers of islands, see dispersion. Of course all byte-wise calculations may be implemented by small, preinitialized lookup tables, indexed by fileset (0..255), containing the number of islands, bitboards of isolated files and whatever else. The maximum number of islands is four.

=Isolated Files= The intersection of east- and west border-files are already files with isolated pawns. code 1 . . . . 1 . . east files of each island 1 . . . 1 . . . west files of each island 1 . . . . . . . and -> isolated files . . . . 1 1 . . xor -> resets isolated files code To isolate wider (2..8) islands is not that hard either.

=External Links= > lineup: Robert Fripp, [|Boz Burrell], [|Ian Wallace], [|Mel Collins], [|Peter Sinfield] with Keith Tippett, [|Mark Charig], [|Harry Miller] and [|Robin Miller] > media type="youtube" key="vBgVTSGNE3I"
 * [|Glossary of chess from Wikipedia - P]
 * King Crimson - [|Islands], 1971, [|YouTube] Video

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