Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: C or C++ for Chess Programming?

Author: Larry Griffiths

Date: 12:49:55 08/16/00

Go up one level in this thread


On August 16, 2000 at 14:38:04, Severi Salminen wrote:

>Hi!
>
>Well, I have to say that yes, my assembly chess program played some chess (maybe
>at 1200 ELO...), but it was indeed hard to write and debug. Now I'm asking how
>does OOP (object oriented programming) suit for chess programming? Or should I
>forget the C++ standard and stick to the plain old C? Are there any efficiency
>aspects involved? I'm asking this because I'm quite new to OOP and would like to
>start studying it only if it benefits chess programming somehow. I'll be using
>the free Borland C++ 5.5
>
>Thanks for any advice!
>
>Severi

Severi,

I have been converting my previous chess code to a more object oriented style.
I still have some globals in my new version.  I have been able to get my object
oriented code to work just as fast as my non-object oriented code.
I only create new instances of my objects when the program starts up.  I have a
pool manager for my pieces.  When I promote a piece, I get it from my piece
pool.  It would be terribly slow if I created and deleted these objects
on-the-fly.

My new code is so much smaller than my previous code and much more manageable.
I have been using OOP for several years now and it can be a frustrating learning
curve, but well worth the journey! :)

I suggest that you go for it!

Larry.




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.