Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Problem with Object Oriented Design (programming issue)

Author: Rick Bischoff

Date: 10:22:02 09/17/03

Go up one level in this thread



>By the way, I DO use abstract piece classes and a lot of the fancy C++ stuff. My
>engine is fairly slow, but in my mind it was worth the price because of the ease
>of testing and debugging individual classes.

It makes absolutely zero sense to do it this way for a couple of reasons.  A)
The pieces on a chess board are limited.. You will never reuse the class You
will never extend the class.  It is basically just "syntantic sugar" that is
causing you a time penalty in exchange for looking good.  I expect that from my
wife, not my chess program!!

(This assumes you are talking about something similar to

class Piece {
public:
  bool color;
  int  square;
  virtual vector<int> moveList(const Board& B) const = 0;
};

class WhitePawn : public Piece {
...
}

etc..

)



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.