testSpeed.c 677 B

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. For testing and optimizing evaluation speed.
  3. */
  4. #include <stdio.h>
  5. #include <time.h>
  6. #include "smallchesslib.h"
  7. #define DEPTH 3
  8. #define EXTRA_DEPTH 4
  9. int main(void)
  10. {
  11. SCL_Board b;
  12. SCL_boardFromFEN(b,"r3kbn1/p1p2ppp/bpn1pq1r/3p4/8/NPQBPN2/P1PP1PPP/R1B1K2R w KQq - 0 1");
  13. SCL_printBoardSimple(b,putchar,255,SCL_PRINT_FORMAT_UTF8);
  14. printf("computing moves (depth: %d, extra: %d)\n",DEPTH,EXTRA_DEPTH);
  15. uint8_t s0, s1;
  16. char p;
  17. uint32_t t = clock();
  18. SCL_getAIMove(b,DEPTH,EXTRA_DEPTH,0,SCL_boardEvaluateStatic,SCL_randomSimple,0,0,0,&s0,&s1,&p);
  19. t = clock() - t;
  20. printf("done: %d %d\n",s0,s1);
  21. printf("it took %d ticks\n",t);
  22. return 0;
  23. }