Author: Tord Romstad
Date: 02:22:51 08/11/04
Go up one level in this thread
On August 10, 2004 at 12:53:36, Uri Blass wrote: >On August 10, 2004 at 12:01:29, Tord Romstad wrote: >>Chess programs are typically rather small and simple programs, written by >>a single person rather than a big team. > >The fact that a single person write a program does not mean that it is a simple >program. That was not what I meant. I made two unrelated statments: 1. Chess engines are small and simple programs. 2. Chess engines are usually written by a single person. I did not mean that 2 implies 1 above. >If I understand correctly you do not have classes. Yes. Gothmog is a plain C program. No C++. >How do you handle time decisions in Gothmog like when to stop the search? I'm not sure how this question is related to C vs C++, but this is basically how it works: When my program starts searching, it calculates two time limits, a "recommended" thinking time and a maximum thinking time. These two limits are based on the time control information (remaining time, number of moves before the next time control, and increment), which is contained in a C struct. Usually, the program will stop searching quickly after the recommended thinking time is consumed. The exception is if it discovers some sort of serious problem, in this case it will continue to think. When the maximum thinking time is reached, it will always move immediately. >I find it as an ugly code when I do not have all the time related functions in >one place and this is the reason that I decided to have a file for time and >using a class if you have one file for this problem is natural decision. I also prefer to partition my source code into many small files, where each file contains just a small number of closely related functions. I don't see what this has to do with classes. It seems like to completely unrelated issues to me. Tord
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.