In Jumbo, which is written in C++, I use templates to model the different hash table use cases. There is a base class "HashTable" which has basically one template parameter "E", there are three hash element data structures "TTHashElement", "PerftHashElement", and "PawnHashElement", and finally there are these derived classes:mvanthoor wrote: ↑Mon Feb 08, 2021 12:52 pmI've just re-instated my old transposition table implementation from a year ago, which was written explicitly for perft. It only stores leaf node counts (and zobrist and depth), so I'll have to change the data structures to be able to save the information needed to use the table for playing games, but its a (working) start.
Code: Select all
class TTHash    : public class HashTable<TTHashElement,    ...> {...}
class PerftHash : public class HashTable<PerftHashElement, ...> {...}
class PawnHash  : public class HashTable<PawnHashElement,  ...> {...}
