Skip to content

Commit

Permalink
implemented BitBoard::player function
Browse files Browse the repository at this point in the history
  • Loading branch information
mbluemer committed Apr 13, 2017
1 parent 50238f7 commit 12d9671
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/BitBoard.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#include <cstdint>
#include <limits.h>
#include <string>
#include "BitBoard.h"

/* Private Functions */

uint32_t const BitBoard::rotl32 (uint32_t n, unsigned int c)
{
const unsigned int mask = (CHAR_BIT*sizeof(n)-1);
Expand All @@ -17,3 +20,10 @@ uint32_t const BitBoard::rotr32 (uint32_t n, unsigned int c)
c &= mask; // avoid undef behaviour with NDEBUG. 0 overhead for most types / compilers
return (n>>c) | (n<<( (-c)&mask ));
}

/* Public functions */

std::string const BitBoard::player()
{
return m_isBlacksTurn ? "black" : "white";
}

0 comments on commit 12d9671

Please sign in to comment.