Author: John Stoneham
Date: 11:38:06 09/10/98
Go up one level in this thread
On September 10, 1998 at 14:20:26, Dan Homan wrote: >Hi John! > >Just read your journal. Very interesting. It sounds like you have a pretty >good game plan going. I just have one question about using classes for >moves and positions. How do you plan to initialize them? Will you create >them on-the-fly or will you create them all when the program starts up and use >them as necessary? > >My program, EXchess, is also a C++ (mostly C) program and I use structures >for moves, positions, etc which are essentially equivalent to classes. I >tested on-the-fly creation versus pre-creation at start-up and found that >on-the-fly creation slowed down the engine significantly (I don't remember >the figure). The only down-side is that this eats up more memory because >I have these data structures always sitting in memory... but I figured that >memory was cheap. :) > > - Dan Hey Dan! Actually, this is kind of getting ahead of myself, but I guess you have to do that when you're working on a chess program :) I plan on having arrays of Move Classes and Position Classes allocated at startup. When dealing with memory issues and arrays, etc., it seems that "proper" code usually leans towards dynamic allocation (with error-checking, NULL pointer tests, etc.), but I feel this would be WAY too slow for tree-searching. -John
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.