Author: Tony Werten
Date: 23:36:45 03/28/03
Go up one level in this thread
On March 28, 2003 at 13:54:23, Russell Reagan wrote: >On March 28, 2003 at 06:32:37, Tony Werten wrote: > >>Wich obviously is wrong. >> >>BB = BITBOARD >> >>BB|=((BB & even int32) shr 32) | ((BB & odd int32) shl 32) >>BB|=((BB & even int16) shr 16) | ((BB & odd int16) shl 16) >>BB|=((BB & even byte) shr 8) | ((BB & odd byte) shl 8) >>BB|=((BB & even nibble) shr 4) | ((BB & odd nibble) shl 4) >>BB|=((BB & even 2bit) shr 2) | ((BB & odd 2bit) shl 2) >>BB|=((BB & even bit) shr 1) | ((BB & odd bit) shl 1) >> >>BITBOARD=BITBOARD XOR (1 shl(63-lsb(BB))) >> >> >>( I'm not claiming it's efficient ) > >I'm not exactly sure what some of your code means, like "even int32" and the >rest. Is it a bit pattern like "10" for even and "01" for odd? Yes, for int32 it would be : odd 10, even 01 (every bit stands for a int32) For int 16 it would be:odd 1010 and 0101. (every bit is a int16 number) So basicly all int16 at an even (odd) location within the int64. Even bit's would be the 0th, 2nd, 4th, 6th etc bit. These lines are used to swap the bits in the int64 >I'm also not sure >what the text qualifies as ok or not. For instance, does OR-EQUAL count? I'm OR-EQUAL just means BB=BB or ... That is definitly a bitwise operation. (One could argue that when something runs on a computer it always is a bitwise operation ) >not >sure. He didn't say. He may have only been talking about a single expression and >not multiple ones. Also, can lsb() be written using only the stated operations? I just used it for extracting the bitnumber. If that's not needed you can use BB&=BB-1 and then swap back again. Tony > >In any case, I may have assumed too much from the text. Thanks for challenging >it :)
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.