| View previous topic :: View next topic |
| Author |
Message |
Dann Corbit
Joined: 08 Mar 2006 Posts: 5125 Location: Redmond, WA USA
|
Post subject: Re: Movei added to Crafty vs Rybka comaprison data Posted: Wed Jun 06, 2007 3:44 am |
|
|
concerning:
| Edsel Apostol wrote: |
| Code: |
{snip}
int getLeastAtkr(const position_t *pos, int *pc, u64 *atkrs){
int sq;
u64 x;
if(x = pos->pawns & *atkrs){
*pc = PAWN;
}else if(x = (pos->knights|pos->bishops) & *atkrs){
*pc = KNIGHT;
}else if(x = pos->rooks & *atkrs){
*pc = ROOK;
}else if(x = pos->queens & *atkrs){
*pc = QUEEN;
}else if(x = pos->kings & *atkrs){
*pc = KING;
}else{
ASSERT(FALSE);
}
sq = getFirstBit(x);
*atkrs ^= BitMask[sq];
return sq;
}
|
|
Why not:
| Code: |
int getLeastAtkr(const position_t *pos, int *pc, u64 *atkrs){
int sq;
u64 x;
if(x = pos->pawns & *atkrs){
*pc = PAWN;
}else if(x = (pos->knights) & *atkrs){
*pc = KNIGHT;
}else if(x = (pos->bishops) & *atkrs){
*pc = BISHOP;
}else if(x = pos->rooks & *atkrs){
*pc = ROOK;
}else if(x = pos->queens & *atkrs){
*pc = QUEEN;
}else if(x = pos->kings & *atkrs){
*pc = KING;
}else{
ASSERT(FALSE);
}
sq = getFirstBit(x);
*atkrs ^= BitMask[sq];
return sq;
}
|
It seems to me that returning an ambiguous piece could be harmful in some situtations (e.g. if you should ever use it for something other than pure counting). |
|
| Back to top |
|
 |
|
| Subject |
Author |
Date/Time |
Comparison data of Crafty vs Rybka that I promised 2 days ag |
Les |
Fri Jun 01, 2007 3:12 am |
Re: Comparison data of Crafty vs Rybka that I promised 2 day |
Dann Corbit |
Fri Jun 01, 2007 3:14 am |
Movei added to Crafty vs Rybka comaprison data |
Les |
Fri Jun 01, 2007 4:06 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Robert Hyatt |
Sat Jun 02, 2007 1:41 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Steven Edwards |
Sat Jun 02, 2007 2:04 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Robert Hyatt |
Sat Jun 02, 2007 5:56 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Dann Corbit |
Sat Jun 02, 2007 4:00 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Dann Corbit |
Sat Jun 02, 2007 4:48 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Robert Hyatt |
Sat Jun 02, 2007 6:00 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Dann Corbit |
Sat Jun 02, 2007 7:18 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Robert Hyatt |
Sun Jun 03, 2007 8:38 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Les |
Sun Jun 03, 2007 11:28 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Edsel Apostol |
Mon Jun 04, 2007 7:10 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Robert Hyatt |
Mon Jun 04, 2007 7:06 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Edsel Apostol |
Tue Jun 05, 2007 6:15 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Dann Corbit |
Tue Jun 05, 2007 7:00 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Edsel Apostol |
Wed Jun 06, 2007 3:29 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Dann Corbit |
Wed Jun 06, 2007 3:44 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Edsel Apostol |
Wed Jun 06, 2007 3:52 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Robert Hyatt |
Wed Jun 06, 2007 1:16 am |
Re: Movei added to Crafty vs Rybka comaprison data |
Dann Corbit |
Tue Jun 05, 2007 7:03 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Gerd Isenberg |
Tue Jun 05, 2007 8:04 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Robert Hyatt |
Mon Jun 04, 2007 7:02 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Gerd Isenberg |
Mon Jun 04, 2007 9:39 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Gerd Isenberg |
Tue Jun 05, 2007 7:55 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Uri Blass |
Tue Jun 05, 2007 9:25 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Gerd Isenberg |
Wed Jun 06, 2007 10:15 pm |
Re: Movei added to Crafty vs Rybka comaprison data |
Robert Hyatt |
Sat Jun 02, 2007 5:58 am |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|