Winglet

a didactic open source chess engines by Stef Luijten written in C++, licensed under the GNU General Public License. The development of Winglet was documented on the website tutorial //Winglet, Writing a Chess Program in 99 Steps//, started in 2011, now hosted by the [|Wayback Machine]. Winglet is intended as bitboard version of TSCP with WinBoard support, and is loosely derived from Wing, Stef Luijten's former private engine , in the meantime also open source. || toc =Description=
 * Home * Engines * Winglet**
 * [[image:Winglet_with_attached_tufts_of_an_KC-135A.jpg link="http://en.wikipedia.org/wiki/File:Winglet_with_attached_tufts_of_an_KC-135A.jpg"]] ||~ || **Winglet**,
 * Winglet ||~ ||^ ||

Board Representation
Winglet applies a mixture of Kindergarten Bitboards and Magic Bitboards to determine sliding piece attacks with 32 [|KiB] precalculated lookup tables[64][64] each on ranks, files, diagonals and anti-diagonals, indexed by square and hashed line occupancy - the inner six bits multiplied by a magic factor and shifted right by the strange looking 57, while 58 is more natural to ensure a six bit index range, using a constant factor (b-File) for all squares of a diagonal or anti-diagonal, ... code format="cpp" U64 arrDiagonalAttacks[64][64]] /* requires initialization */

U64 diagonalKindergartenAttacks(U64 occ, enumSquare sq) { occ = (diagonalMaskEx[sq] & occ) * C64(0x0202020202020202) >> 58; return arrDiagonalAttacks[sq][occ]; } code ... but "magic" Winglet factors are designed such that the most significant bit of the 64-bit product will always be clear, that is positive if interpreted as signed 64-bit integer. It seems, Winglet's occupied index calculations emulate Wing's rotated bitboard indices for same attack table layout: code format="cpp" /*                Winglet's occupancy state             ==            Wing's occupancy state */ (occ & MG_DIAGA8H1MASK[sq]) * MG_DIAGA8H1MAGIC[sq] >> 57 == (occ045 >> DIAGA8H1_ATTACK_SHIFT[sq]) & 63 (occ & MG_DIAGA1H8MASK[sq]) * MG_DIAGA1H8MAGIC[sq] >> 57 == (occ315 >> DIAGA1H8_ATTACK_SHIFT[sq]) & 63 (occ & MG_FILEMASK[sq])    * MG_FILEMAGIC[sq])    >> 57 == (occ090 >> FILE_ATTACK_SHIFT[sq])     & 63 code

Search

 * Iterative Deepening
 * Alpha-Beta
 * Principal Variation Search
 * Quiescence Search
 * MVV-LVA
 * Static Exchange Evaluation
 * Null Move Pruning

Evaluation
> Passed Pawn > Backward Pawn > Doubled Pawn > Isolated Pawn > Pawn Shield > King Tropism
 * Material Balance
 * Piece-Square Tables
 * Pawn Structure
 * Bishop Pair
 * Rook on Open File
 * Rook behind Passers
 * King Safety in Opening, Middlegame
 * King Centralization in Endgame

=See also=
 * Chesser by Syed Fahad
 * Godot by Ulysse Carion
 * Kenny by Kenshin Himura
 * Vajolet by Marco Belli
 * Wing by Stef Luijten

=Postings=
 * [|writing a chess engine in xx steps] by wing, Winboard Forum, April 18, 2011
 * [|Writing a chess program in xx steps] by Stef Luijten, CCC, April 18, 2011
 * [|Chess Programming/Concepts for Beginners] by MoldyJacket, OpenChess Forum, April 18, 2011
 * [|Winglet Chess Engine; Revived!] by [|PortugalTheMan], [|Chess.com], Septermber 24, 2014

=External Links=

Chess Engine

 * [|Index of /chess/engines/Jim Ablett/WINGLET] by Jim Ablett, hosted by Kirill Kryukov
 * [|PortugalTheMan/winglet · GitHub]
 * [|winglet, writing a chess program in 99 steps] by Stef Luijten, hosted by Abdullah Al-Ghaznawi

Tutorial Archive
include page="Winglet to include"

Misc

 * [|Winglet from Wingtip device - Wikipedia]
 * [|Winglets and Sharklets | The Flying Engineer]
 * [|Boeing 737 Winglets]
 * [|Winglets | Airbus, a leading aircraft manufacturer]

=References= =What links here?= include page="Winglet" component="backlinks" limit="40"
 * Up one Level**