daily pastebin goal
27%
SHARE
TWEET

main.cpp

a guest Mar 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include "bitboard.h"
  3. #include "position.h"
  4. #include "search.h"
  5. #include "thread.h"
  6. #include "tt.h"
  7. #include "uci.h"
  8. #include "syzygy/tbprobe.h"
  9. #include <stdlib.h>
  10. #include <time.h>
  11.  
  12.  
  13. namespace PSQT {
  14.     void init();
  15. }
  16.  
  17.  
  18.  
  19. int main(int argc, char* argv[]) {
  20.  
  21.     std::cout << engine_info() << std::endl;
  22.    
  23.     UCI::init(Options);
  24.     PSQT::init();
  25.     Bitboards::init();
  26.     Position::init();
  27.     Bitbases::init();
  28.     Search::init();
  29.     Pawns::init();
  30.     Threads.set(4);
  31.     Search::clear(); // After threads are up
  32.  
  33.     StateInfo si;
  34.     Position pos;
  35.     int i;
  36.  
  37.     pos.set("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", false, &si, pos.this_thread());
  38.    
  39.     auto moveList = MoveList<LEGAL>(pos);
  40.     srand(time(NULL));
  41.  
  42.     while (moveList.size() > 0)
  43.     {
  44.         i = rand() % moveList.size();
  45.         pos.do_move(moveList.moveList[i].move, StateInfo(si));
  46.         moveList = MoveList<LEGAL>(pos);
  47.     }
  48.  
  49.     Threads.set(0);
  50.     return 0;
  51.  
  52. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top