Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any 0x88 format engine?

Author: Russell Reagan

Date: 13:20:47 06/04/04

Go up one level in this thread


On June 04, 2004 at 10:39:07, Thorsten Greiner wrote:

>Gopikrishna, you made me really curious! I have just downloaded the Gerbil
>source code and had a look at it.
>
>I would suggest that you first ignore all the sources in the winboard directory
>and start in the engine directory. The move generator is in gen.c in the routine
>'VGenMoves'. Study this first!
>
>Moves are made/unmade in makemove.c in the methods VMakeMove/VUnmakeMove. Study
>them second!
>
>Another suggestion would be to start the executable in a debugger (I hear the
>Microsoft products are very strong in this area) and look at the operations
>performed from there.

You (Gopikrishna) also need to see what is in engine.h. At the very least you
need to be familiar with what PCON and PSTE are, or you won't understand how
they are used in gen.c and makemove.c.

Gerbil takes a little bit of time to get used to (like most engines probably).
Once I read over engine.h a few times and got a feel for the overall structure
of the program, it was much easier to understand everytyhing else.

When I first learned it, I think I just started at main() and traced how it
would run. It was tedious, and not very fun, but very rewarding. Whenever I
encountered a function call or data structure reference for the first time, I
went to its declaration and definition. You could say it was similar to
increasing your vocabulary, or learning a new spoken language. Every time I
encountered something new, I looked it up, and after I while I remembered a
little bit, then a little bit more, and then it started making sense.

The details of many things are not very important for learning from Gerbil. If
you want to understand the Winboard code, just focus on that and don't worry
about the move generator yet. If you just want to learn how the move generator
works, focus on that, and don't worry about how the Winboard code works. It
seems like you are trying to understand the entire program at once. If you don't
understand the Winboard stuff yet, just make a mental note, "This stuff handles
the Winboard protocol," and move on to some other part.

If you are trying to learn the C language while trying to learn Gerbil, that's
probably not a good idea, since concepts like pointers (and thus callback
functions), Hungarian notation, and things like that won't make sense to you.



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.