Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: OOP: objects and methods

Author: Robert Hyatt

Date: 09:14:04 09/22/03

Go up one level in this thread


On September 21, 2003 at 23:25:15, Edward Seid wrote:

>On September 21, 2003 at 21:15:06, Robert Hyatt wrote:
>
>> A chess board is a good example of an object.  There is
>>no need to create a bunch of them, one is enough.  I've personally seen more
>>than one _really_ elegant OO (C++) chess program that was just as fast as
>>mine (it was a bitboard program also).
>
>OK, so a chessboard is a good object for an OOP-oriented chess program.  What
>other things would be good to represent as objects?
>For the chessboard and other objects, what would be the attributes and methods
>of each object?
>
>(Sorry that I ask so many questions, but I promise the next one won't be "Write
>me code to do the above")

The transposition table is a natural.  The opening book.  The endgame tables.
The repetition history.  The killer move list.

The only thing to avoid is constantly creating and destroying things.  If you
avoid that, c++ is just as good as C.  Note that Eugene's endgame probe code
is written in c++ with _no_ speed penalty.  Someone converted it to plain C
a while back and there was no speed advantage.



This page took 0.01 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.