Author: Gerd Isenberg
Date: 02:17:48 01/08/04
Go up one level in this thread
On January 07, 2004 at 14:25:48, Andreas Herrmann wrote: >Hi Ed, > >i'm just reading in your Rebel internals about your attack tables, they are >totally diffrent than mine, but i like your structure. >But how do you handle more than 1 attacker from the same kind? It seems that >this is not possible in your structure, or have i overread something? > >What about the following, if using a 16 bit integer: >Bit 1 to 3: total number of attackers >Bit 4 to 5: number of attacking pawns >Bit 6 to 7: number of attacking bishops and knights >Bit 8 to 9: number of attacking rooks >Bit 10 to 11: number of attacking queens >Bit 12 to 16: free for other stuff > >Ok this needs more time to fill, and the calculating of hanging pieces needs a >much bigger array, which gives me a result back, but i could handle all kinds of >attackings. > >thanks in advance for your answer >Andreas Hi Andreas, it's a tradeoff between space and accuracy. Ed's byte values allow a fast table lookup whether a piece is enprise or hanging or whether a square is safe to enter with some piece for one side: get_next_piece_on_the_board // scan the board // get status via the bits status = TABLE [piece_type] [WB[square]] [BB[square]]; if (status == 0) continue; // piece safe -> next square else: piece hangs, status contains its value // Q=9 R=5 B=3 N=3 P=1 char TABLE [12] [256] [256]; // about 860 Kb If you use a more accurate 11-bit word, the table size becomes 2**6 = 64 times bigger: char TABLE [12] [2048] [2048]; // about 48 Mb I guess that huge lookup-table don't pays off. Cheers, Gerd
This page took 0.01 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.