Author: Ratko V Tomic
Date: 09:24:55 10/17/00
Go up one level in this thread
> my check detection: if( AttackTables[xside][kingsquare] )
> flag |= kingincheck;
Note that using a bit-flag for kingincheck is more expensive than
using a byte for it. Namely the operation:
flag |= kingincheck;
requires processor to first read "flag" variable before it can set a bit and
write it back to memory. Alternative:
flags[INCHECK]=1;
where INCHECK is constant (array index) and flags[] array of bytes, needs only a
memory write. Note also that you can check (or set) up to 4 flags[]
simultaneously with a single memory read by casting the access to flags[] as
(int) or (short) as necessary.
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.