int board[64], f, r, sm, sq, s; for (f = 1; f < 8; ++f) for (r = 0; r < f; ++r) { sq = 8*r + f; sm = 8*f + r; s = board[sq]; board[sq] = board[sm]; board[sm] = s; }
Table of Contents
Diagonal mirroring mirrors all pieces along the main diagonal or main anti-diagonal. It is applicable in pawn-less endgames with castling no longer possible. Along with horizontal and/or vertical flipping, diagonal mirroring is used in pawn-less endgame tablebases to restrict a white king to the 10 squares of the a1-d4-d1 triangle of the board.
Sample Position
Mirroring an 8x8 Board
An 8x8 Board with a rank-file mapping needs to swap rank and file. A pure 8x8 Board may be mirrored along the main diagonal that way in C:See also
External Links
What links here?
Up one Level