I have the following code and want to know which is the fastest way to copy the _zobrist
and _hashEnPassant
arrays?
internal void InitHash()
{
Int32 i;
for ( i = 0; i < 2; i++ )
for ( Int32 j = 0; j < 6; j++ )
for ( Int32 k = 0; k < 64; k++ )
_zobrist[ i, j, k ] = HashRand();
for ( i = 0; i < 64; ++i )
_hashEnPassant[ i ] = HashRand();
}
The reason for is this that my chess engine creates multiple analysis boards and rather than recreating new boards from scratch I basically clone an existing board. The issue I am having is that calling the InitHash()
method or just doing a simple copy is too slow.
I have looked at this and am not sure how to modify this to work with UInt64 types.