understanding fruit

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

understanding fruit

Postby Uri Blass » 18 Jun 2005, 11:00

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
User avatar
Uri Blass
 
Posts: 727
Joined: 09 Oct 2004, 05:59
Location: Tel-Aviv

Re: understanding fruit

Postby Chan Rasjid » 18 Jun 2005, 12:11

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.
Chan Rasjid
 
Posts: 73
Joined: 23 Feb 2005, 16:36
Location: Singapore

Re: understanding fruit

Postby Reinhard Scharnagl » 18 Jun 2005, 12:12

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.
Reinhard Scharnagl
 
Posts: 608
Joined: 01 Oct 2004, 08:36
Location: Klein-Gerau, Germany

Re: understanding fruit

Postby Dann Corbit » 18 Jun 2005, 12:13

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
Dann Corbit
 

Re: understanding fruit

Postby Pallav Nawani » 18 Jun 2005, 12:52

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
User avatar
Pallav Nawani
 
Posts: 147
Joined: 26 Sep 2004, 20:00
Location: Dehradun, India

Re: understanding fruit

Postby Dann Corbit » 18 Jun 2005, 13:07

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.
Dann Corbit
 

Re: understanding fruit

Postby Fabien Letouzey » 19 Jun 2005, 09:15

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.
Fabien Letouzey
 
Posts: 110
Joined: 03 Dec 2004, 10:17
Location: France


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 9 guests