Files

toc
 * Home * Chess * Files**

//For disambiguation see also [|Computer file] //


 * Files** are the eight vertical lines or columns of a Chessboard, labeled from 'A' to 'H', or 'a' to 'h'. Each file contains eight vertically arranged Squares of alternating white and black, or light and dark Color. In a descriptive notation, files are also nominated by the Pieces from their initial position (similar to Pawns), like Rook-Files (A- and H-File), Knight-Files (B- and G-File), Bishop-Files (C- and F-File), and Queen-File (D-File) and King-File (E-File), also called Center Files.

=Square Mapping Notes= Whether the square difference of neighbored squares on a rank or file is either 1 or 8, depends on the square mapping. We further rely on little-endian rank-file mapping, which keeps consecutive squares of a rank as neighbored elements in Memory (or register).

=Square Difference= Within a 0..63 square index range and the mentioned square mapping (a1 = 0), the difference of two neighbored squares on a File is **eight**.

=Enumeration= As mentioned, on a Chessboard the eight files are labeled from 'A' to 'H'. To make them zero based indices as appropriate for C like programming languages, we enumerate files from 0 to 7. Little-endian file-mapping (as used here) assigns the A-File to index zero. Three bits are required to enumerate from 0 to 7.

A little-endian file-mapping enumeration in C++ might look like this: code format="cpp" enum enumFile { efAFile = 0, efBFile = 1, efCFile = 2, efDFile = 3, efEFile = 4, efFFile = 5, efGFile = 6, efHFile = 7, }; code =File from Square= Rank-File mapping of squares keeps the file as the three lower bits of a Square index. code file = square & 7; // modulo 8 code  =File-Distance= The file-distance is the absolute difference between two files (their 0-7 indices). The maximum file-distance is 7. code format="cpp" fileDistance = abs (file1 - file2); fileDistance = abs (file2 - file1); code =See also=
 * Half-open file
 * Open file
 * Pawns and Files (Bitboards)
 * Ranks
 * Diagonals
 * Anti-Diagonals
 * Squares
 * Intersection Squares

=What links here?= include page="Files" component="backlinks" limit="120"
 * Up one Level**