Page 1 of 1

understanding fruit

PostPosted: 18 Jun 2005, 11:00
by Uri Blass
I find in fruit pawn.cpp the following variables

int BitEQ[16];
int BitLT[16];
int BitLE[16];
int BitGT[16];
int BitGE[16];

int BitFirst[0x100];
int BitLast[0x100];
int BitCount[0x100];
int BitRev[0x100];

When I can guess what it the meaning of the last variables from the name it is hard to understand the meaning of the first variable only based on the name and I do not like reading the source only to guess from it what they mean.

I think that it is better if source code at least include some file that explain the meaning of the variables in english,unless it is obvious by the name or they are explained at the file that they are defined.

Uri

Re: understanding fruit

PostPosted: 18 Jun 2005, 12:11
by Chan Rasjid
int BitEQ[16];
int BitLT[16];
int BitLE[16];
int BitGT[16];
int BitGE[16];

EQ =equal, ...<, <=, >, >= .... but I will never know for what purposes.

crafty's have some brief commentaries about what it is trying to do, but
no commentaries in Fruit.

Re: understanding fruit

PostPosted: 18 Jun 2005, 12:12
by Reinhard Scharnagl
Uri,

such comments like yours here are hardly to find. Maybe patchworkers are satisfied to get a compiler compile their patchwork. So why bother with any understanding of code, or even further of computer chess? A compiler never asks for any related idea or an understood concept.

Reinhard.

Re: understanding fruit

PostPosted: 18 Jun 2005, 12:13
by Dann Corbit
Uri Blass wrote:I find in fruit pawn.cpp the following variables
Code: Select all
int BitEQ[16];
int BitLT[16];
int BitLE[16];
int BitGT[16];
int BitGE[16];

[/quote="Uri Blass"]
These are rank translators for going from bitboard to 0x88
Uri Blass wrote:
Code: Select all
int BitFirst[0x100];
int BitLast[0x100];
int BitCount[0x100];
int BitRev[0x100];

[/quote="Uri Blass"]
These are also for bitboard translation.
BitFirst is for the first set bit
BitLast is for the last set bit
BitCount is the number of bits
BitRev is to reverse the bits.
Uri Blass wrote:When I can guess what it the meaning of the last variables from the name it is hard to understand the meaning of the first variable only based on the name and I do not like reading the source only to guess from it what they mean.

I think that it is better if source code at least include some file that explain the meaning of the variables in english,unless it is obvious by the name or they are explained at the file that they are defined.

Uri

Re: understanding fruit

PostPosted: 18 Jun 2005, 12:52
by Pallav Nawani
Dann Corbit wrote:These are rank translators for going from bitboard to 0x88


I don't want to hijack this thread, but Dann, how come you haven't written your own chess engine? Or have you? I know that you've worked on Beowulf.

Pallav

Re: understanding fruit

PostPosted: 18 Jun 2005, 13:07
by Dann Corbit
Pallav Nawani wrote:
Dann Corbit wrote:These are rank translators for going from bitboard to 0x88


I don't want to hijack this thread, but Dann, how come you haven't written your own chess engine? Or have you? I know that you've worked on Beowulf.

Pallav


I have contributed code snippets to a few engines.

I have a thing I call "bean counter" that resembles a chess engine.
Most everything about it is quite different from other engines.

I plan to release it if it ever meets my expectations (pounds the top programs into dust). I will (at that time) give also the source to my chess friends.

It tends to undergo major surgery every so often and even becomes completely unplayable once in a while.

For me I think that the journey is more interesting than the destination anyway.

I may never get there, but I won't mind if I don't.

Re: understanding fruit

PostPosted: 19 Jun 2005, 09:15
by Fabien Letouzey
Uri Blass wrote:int BitEQ[16];
int BitLT[16];
int BitLE[16];
int BitGT[16];
int BitGE[16];


Hi Uri,

These abbreviations are standard in low-level programming. Fruit uses "bitfiles" for pawn-feature detection. They are used e.g. for pawn shelters and storms.

As I say in the readme file, this is a hurry release and I have not had the time to add any comment for readers.

Maybe next time,

Fabien.