Skip to content

Commit

Permalink
Changed rotate180 to flip_rank.
Browse files Browse the repository at this point in the history
  • Loading branch information
nodchip committed Aug 30, 2020
1 parent 2101969 commit 2ca7baf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/nnue/features/enpassant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Eval {
}

if (perspective == BLACK) {
epSquare = rotate180(epSquare);
epSquare = flip_rank(epSquare);
}

auto file = file_of(epSquare);
Expand Down
4 changes: 2 additions & 2 deletions src/nnue/features/half_kp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

namespace Eval::NNUE::Features {

// Orient a square according to perspective (rotates by 180 for black)
// Orient a square according to perspective (flip rank for black)
inline Square orient(Color perspective, Square s) {
return Square(int(s) ^ (bool(perspective) * 63));
return Square(int(s) ^ (bool(perspective) * SQ_A8));
}

// Find the index of the feature quantity from the king position and PieceSquare
Expand Down
4 changes: 2 additions & 2 deletions src/nnue/features/half_relative_kp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace NNUE {

namespace Features {

// Orient a square according to perspective (rotates by 180 for black)
// Orient a square according to perspective (flip rank for black)
inline Square orient(Color perspective, Square s) {
return Square(int(s) ^ (bool(perspective) * 63));
return Square(int(s) ^ (bool(perspective) * SQ_A8));
}

// Find the index of the feature quantity from the ball position and PieceSquare
Expand Down
4 changes: 2 additions & 2 deletions src/nnue/features/k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace NNUE {

namespace Features {

// Orient a square according to perspective (rotates by 180 for black)
// Orient a square according to perspective (flip rank for black)
inline Square orient(Color perspective, Square s) {
return Square(int(s) ^ (bool(perspective) * 63));
return Square(int(s) ^ (bool(perspective) * SQ_A8));
}

// Index of a feature for a given king position.
Expand Down
4 changes: 2 additions & 2 deletions src/nnue/features/p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace NNUE {

namespace Features {

// Orient a square according to perspective (rotates by 180 for black)
// Orient a square according to perspective (flip rank for black)
inline Square orient(Color perspective, Square s) {
return Square(int(s) ^ (bool(perspective) * 63));
return Square(int(s) ^ (bool(perspective) * SQ_A8));
}

// Find the index of the feature quantity from the king position and PieceSquare
Expand Down

0 comments on commit 2ca7baf

Please sign in to comment.