Author: KarinsDad
Date: 22:29:35 11/29/99
Go up one level in this thread
Or in simpler terms, this function indicates the leftmost bit (highest) which is set in a given 16 bit integer (i.e. msb is Most Significant Bit). This function is called once in the initialization of the code so that it is a simple table (array) lookup in order to get the msb. You could probably use msb for a variety of things. I do not use it yet in my code (especially a 16 bit version), but one thing I may use it for some day is to access the first square attacked in a row/column (for rooks or queens) or diagonal (for bishops or queens) as opposed to shifting out all of the bits from the highest order bit (which I currently do). However, I haven't had the time to add this performance enhancement yet. KarinsDad :)
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.