Difference between revisions of "Horizontal Mirroring"

From Chessprogramming wiki
Jump to: navigation, search
m
 
Line 56: Line 56:
 
* [https://en.wikipedia.org/wiki/Reflection_%28physics%29 Reflection (physics) from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Reflection_%28physics%29 Reflection (physics) from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Reflection_symmetry Reflection symmetry from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Reflection_symmetry Reflection symmetry from Wikipedia]
 +
* [http://math.ucr.edu/home/baez/physics/General/mirrors.html Why do Mirrors Reverse Left and Right?]
 
* [https://en.wikipedia.org/wiki/Venus_effect Venus effect from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Venus_effect Venus effect from Wikipedia]
* [http://math.ucr.edu/home/baez/physics/General/mirrors.html Why do Mirrors Reverse Left and Right?]
+
* [[:Category:Shocking Blue|Shocking Blue]] - [https://en.wikipedia.org/wiki/Venus_(Shocking_Blue_song) Venus] (1970), [https://en.wikipedia.org/wiki/YouTube YouTube] Video
 +
: {{#evu:https://www.youtube.com/watch?v=aPEhQugz-Ew|alignment=left|valignment=top}}
  
 
=References=  
 
=References=  
Line 63: Line 65:
  
 
'''[[Chess Position|Up one Level]]'''
 
'''[[Chess Position|Up one Level]]'''
 +
[[Category:Shocking Blue]]

Latest revision as of 00:17, 19 December 2018

Home * Chess * Position * Horizontal Mirroring

Mirroring [1]

Horizontal Mirroring mirrors all pieces along the vertical axis between the D- and E-File. Applicable if both sides have lost their castling rights, horizontal mirroring should result in equal static evaluation score, but not necessarily equal search result if pieces and squares are traversed in different order. Along with vertical flipping and/or diagonal mirroring, horizontal 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

Horizontal Mirroring

Original Horizontal Mirroring
    
    
    
    
    
    
    
    
       
        
     
        
        
        
        
        
♚       
        
♘♔  ♗   
        
        
        
        
        
    
    
    
    
    
    
    
    
       
        
     
        
        
        
        
        
       ♚
        
   ♗  ♔♘
        
        
        
        
        
k7/8/NK2B3/8/8/8/8/8 w - - 7k/8/3B2KN/8/8/8/8/8 w - -

Flipping & Rotation

Vertical flipping and horizontal mirroring (or vice versa) results in rotation by 180 degrees.

Vertical Flipping 180° Rotation
    
    
    
    
    
    
    
    
        
        
        
        
        
     
        
       
        
        
        
        
        
♘♔  ♗   
        
♚       
    
    
    
    
    
    
    
    
        
        
        
        
        
     
        
       
        
        
        
        
        
   ♗  ♔♘
        
       ♚
8/8/8/8/8/NK2B3/8/k7 w - - 8/8/8/8/8/3B2KN/8/7k w - -

Mirroring an 8x8 Board

An 8x8 Board with a rank-file mapping needs to perform an exclusive or with 7 (h1 in LERF) to horizontally mirror square coordinates. A pure 8x8 Board may be mirrored that way in C:

int board[64], sq, s;

for (sq = 0; sq < 64; sq += ++sq & 4)  {
  s = board[sq];
  board[sq] = board[sq^7];
  board[sq^7] = s;
}

See also

External Links

References

Up one Level