]> git.sesse.net Git - stockfish/blobdiff - src/bitboard.h
Fix random moves when time < 10ms
[stockfish] / src / bitboard.h
index e0e2fe64545ececedd4acf53852b9fd7e3b7dbf0..3afbeedfbab42ee086000de51a4964350b34bea5 100644 (file)
@@ -319,9 +319,10 @@ extern Square pop_lsb(Bitboard* b);
 
 #endif
 
-/// lsb() overload finds least significant bit relative to the given color
-inline Square lsb(Color c, Bitboard b) {
-  return c == WHITE ? lsb(b) : msb(b);
-}
+/// frontmost_sq() and backmost_sq() find the square corresponding to the
+/// most/least advanced bit relative to the given color.
+
+inline Square frontmost_sq(Color c, Bitboard b) { return c == WHITE ? msb(b) : lsb(b); }
+inline Square  backmost_sq(Color c, Bitboard b) { return c == WHITE ? lsb(b) : msb(b); }
 
 #endif // #ifndef BITBOARD_H_INCLUDED