fixed PlayRandMoves()
This commit is contained in:
1 parent
ebdf295eec
commit
ee59c8a455
1 file changed
+2
-3
+2
-3
@@ -8,14 +8,13 @@
|
|||||||
|
|
||||||
namespace DATAGEN {
|
namespace DATAGEN {
|
||||||
|
|
||||||
// TODO: Causes segment fault
|
|
||||||
static void PlayRandMoves(Board &board) {
|
static void PlayRandMoves(Board &board) {
|
||||||
std::random_device dev;
|
std::random_device dev;
|
||||||
std::mt19937 rng(dev());
|
std::mt19937 rng(dev());
|
||||||
|
|
||||||
for (int count = 0; count < RAND_MOVES; count++) {
|
for (int count = 0; count < RAND_MOVES; count++) {
|
||||||
MOVEGEN::GenerateMoves<All>(board);
|
MOVEGEN::GenerateMoves<All>(board);
|
||||||
std::uniform_int_distribution<std::mt19937::result_type> dist(0, board.currentMoveIndex);
|
std::uniform_int_distribution<std::mt19937::result_type> dist(0, board.currentMoveIndex - 1);
|
||||||
|
|
||||||
bool isLegal = board.MakeMove(board.moveList[dist(rng)]);
|
bool isLegal = board.MakeMove(board.moveList[dist(rng)]);
|
||||||
if (!isLegal) count--;
|
if (!isLegal) count--;
|
||||||
@@ -48,7 +47,7 @@ void Run(int games) {
|
|||||||
std::memset(SEARCH::killerMoves, 0, sizeof(SEARCH::killerMoves));
|
std::memset(SEARCH::killerMoves, 0, sizeof(SEARCH::killerMoves));
|
||||||
SEARCH::history.Clear();
|
SEARCH::history.Clear();
|
||||||
|
|
||||||
//PlayRandMoves(board);
|
PlayRandMoves(board);
|
||||||
|
|
||||||
SEARCH::SearchResults safeResults;
|
SEARCH::SearchResults safeResults;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user