How to use a Polyglot book in C# with a chess engine I would like, if possible, for someone to provide a code snippet of a basic logic to access a Polyglot book file. I'm having trouble finding the file format documentation, so I don't know how to access it and use it in the code. I'm making a chess game and would like to use the books to support features in the game. If not too much trouble, I would rather have a c# code sample, since it's the language I'm fluent with right now.
Sorry, I don't have C# code. Can we do it in C++?


https://github.com/Warpten/Fruit-2.1/blob/master/src/book.cpp


Polyglot book is defined like:

struct entry_t {
   uint64 key;
   uint16 move;
   uint16 count;
   uint16 n;
   uint16 sum;
};


You may want to wrap the C++ code inside your C#. How to do that is out of scope here.