Why are you doing all the work for him ?Daniel Shawul wrote:This improves collision rate very slightly i.e. xoring the 'from' square for all pieces except bishops. It brought down collision rate from 3000coll/mill to 2900coll/mill. The major problem is that white and black have same keys. Fixing that in such a way that black have ~b reduces collision rate to 100coll/mill ! This is good but still no better than a simple fnv1a that gives 60coll/mill right way. It is simple and fast, OTOH generating attacks with magics is darn slow. For 28 bit key i am sure it would be much worse since attacks sets have some structure that requires all the 64 bit keys for maximum performance.Code: Select all
U64 gusev(int cp, int sq) { int pc = cp / 2; int co = cp % 2; U64 b=0; switch(pc) { case 0: b=unitBB(sq) | king_attacks(sq); break; case 1: b=unitBB(sq) | knight_attacks(sq); break; case 2: b=bishop_attacks(sq,0); break; case 3: b=unitBB(sq) | rook_attacks(sq,0); break; case 4: b=unitBB(sq) | queen_attacks(sq,0); break; case 5: b=unitBB(sq) | pawn_attacks(sq,co); break; } if(co == 1) b=~b; //black has negation return b; }
He hasn't written a single line of code and tested anything himself. So he really doesn't deserve that you spend your time doing his homework, IMO.
Besides, he'll never learn by reading forum posts. He has to do things for himself. Just like the other troll...
