Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: When building big arrays make sense?

Author: Gerd Isenberg

Date: 12:06:52 10/28/02

Go up one level in this thread


On October 28, 2002 at 14:06:54, Uri Blass wrote:

>On October 28, 2002 at 13:17:56, Uri Blass wrote:
>
><snipped>
>>My question is if array is the fastest way to do other things like finding if a
>>rook move is pseudo legal.
>>
>>rook move is pseudo legal if the file is the same file or the rank is the same
>>rank(I can ignore the case when both are the same because this case never happen
>>and I never expect hash move or killer move when both are the same even in case
>>of hash collision)
>
>After thinking more about the problem it seems that my 2 dimentional array is
>not the same as checking if the move is pseudo legal because when I get the
>direction between the squares I get more information than knowing if the move is
>pseudo legal(the exact direction between the squares(left,right,up,down)
>and this information is used later.
>
>The main question if there is a fast way to calculate the function
>direction(x,y) when
>1)direction(x,y)=0 for up direction
>2)direction(x,y)=1 for down direction
>3)direction(x,y)=2 for left direction
>4)direction(x,y)=3 for right direction
>
>only a function that is faster than 64*64 array is productive.
>
>I am interested in the same question for bishop when direction(x,y) can get
>4,5,6,7.
>
>Uri

I think a two dimensional precalculated 64*64 array makes sense, if you pack
some more additional but often used information in it, like an index of the
common ray or some distances, like taxi-distance, knight-distance, unique
distance relations or common square color.

But if it's possible on the fly, with some cheap calculations without
conditional jumps and memory access it may be preferable.
In these cases i try both, 64*64 lookup versus calculation and use conditional
compiling, to see from time to time what is currently faster.

Gerd




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.