Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Fastest Conversion from 0x88 board to 8x8 board representation

Author: Miguel A. Ballicora

Date: 13:11:00 07/06/01

Go up one level in this thread


On July 06, 2001 at 15:09:20, Artem Pyatakov wrote:

>Thanks for the fast reply. I do not understand how I can avoid a 128x128 history
>table... The fastest and most standard method is history[move.from][move.to]...
>And for a 0x88 representation both move.from and move.to range from 0 to 128.
>
>Could you clarify your suggestion? Thanks.
>
>Artem Pyatakov

Sorry, my brain was unplugged...
I will try again.

So if your concern is to shrink the history table you can do something this:

int history [64][64];
int retrieved_value, store_value;

/* 112 is 7<<4 or binary 01110000 */
/* the conversion translates bits like 01110111 to 00111111 */
/* the idea is to move the upper bits one position to the right */

history [from&7 | ((from&112)>>1)]  [to&7 | ((to&112)>>1)] = store_value;

retrieved_value = history [from&7 | ((from&112))>>1]  [to&7 | ((to&112)>>1)];

This is untested!! I just coded it. Check it!

Regards,
Miguel







This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.