mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Consolidate Square Flipping
Add a flip_rank() and flip_file() so that all of the square flipping can be consolidated.
STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 57234 W: 11064 L: 10969 D: 35201
Ptnml(0-2): 822, 6562, 13801, 6563, 869
http://tests.stockfishchess.org/tests/view/5e5d2f2aafe6254521f2ffaa
closes https://github.com/official-stockfish/Stockfish/pull/2568
No functional change.
This commit is contained in:
committed by
Joost VandeVondele
parent
c6839a2615
commit
960d59d541
@@ -358,8 +358,12 @@ constexpr Color operator~(Color c) {
|
||||
return Color(c ^ BLACK); // Toggle color
|
||||
}
|
||||
|
||||
constexpr Square operator~(Square s) {
|
||||
return Square(s ^ SQ_A8); // Vertical flip SQ_A1 -> SQ_A8
|
||||
constexpr Square flip_rank(Square s) {
|
||||
return Square(s ^ SQ_A8);
|
||||
}
|
||||
|
||||
constexpr Square flip_file(Square s) {
|
||||
return Square(s ^ SQ_H1);
|
||||
}
|
||||
|
||||
constexpr Piece operator~(Piece pc) {
|
||||
|
||||
Reference in New Issue
Block a user