Fabien, thanks for sharing all these details.
In the meantime I was able to compile (without errors) the Scan source code with the Microsoft Visual Studio Community Edition 2013. This development environment is now completely free for non commercial usage.
A few things I needed to change before all worked (In 64bit mode), and as I'm not a hyper C++ expert (like Rein), there might be better and simpler options to solve the mentioned issues.
Or it might be that the soon to be published version 2015 solves a few issues.
So in random order: * I got a strange error min (and max) is not a member of std. I solved it to add #include <algorithm)
* Same for isdigit, but here the #include didn't work, so i just removed the std:: and then all seemed to work.
* To switch off all special Microsoft security errors (for some input output functions), I added _CRT_SECURE_NO_WARNINGS in the Preprocessor Definitions (Project Properties, C/C== Preprocessor)
* To enable 64bit intrinsic I switched USE_INLINE to true, #define USE_INLINE TRUE
* I had to slightly change intrinsic definitions, and added #include <intrin.h> in the bit.h header file:
// inline int bit_first (bit_t b) { assert(b != 0); return __builtin_ctzll(b); }
inline int bit_first(bit_t b) { unsigned long uBit; assert(b != 0); _BitScanForward64(&uBit, b); return (uBit); }
// inline int bit_count (bit_t b) { return __builtin_popcountll(b); }
inline int bit_count(bit_t b) { return __popcnt64(b); }
A remaining question.in the bd.trit[square] which you use to calculate the index for a specific region , I assume the value is 1 for empty, 0 for a white man, and 2 for a black man.
In case of white and black king is the value than also 1 (as empty) ?
Quote:
Data structures: I started Scan using old code so there is still a mix of bitboards (e.g. for move generation) and arrays (for pattern evaluation).
I have also seen this, and basically I have/had the same in Damage (and still some traces in the program nowadays), but im (still) working to make Damage 100% bitboard based (which is now 95% i guess). It might be that it is possible without time penalty to replace the i8 function ( static int i8(const Board & bd, int s0, int s1, int s2, int s3, int s4, int s5, int s6, int s7) { ) by a bitboard alternative, so you don't need to incrementally update the p_trit arrays(s), (and p_square).
In general, I found the Scan evaluation function (extremely beautiful in simplicity, with the real complexity is in the underlying data structure), and your code in general very elegant, very well structured, and a source of inspiration and motivation for everyone, to continue with Draughts program development.
So thanks again for sharing, and raising the bar.
Bert