Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Crafty null move question

Author: Steffen Jakob

Date: 00:26:01 07/18/02

Go up one level in this thread


On July 18, 2002 at 03:13:46, Uri Blass wrote:

>On July 18, 2002 at 02:25:50, Steffen Jakob wrote:
>
>>On July 18, 2002 at 00:37:57, Robert Hyatt wrote:
>>
>>>On July 17, 2002 at 16:30:24, Patrik wrote:
>>>
>>>>Hello, Dr Hyatt.
>>>>
>>>>  if (do_null && !tree->in_check[ply] && pieces && (pieces>5 || depth<421)) {
>>>>
>>>>Where does the depth 421 come from?
>>>>
>>>>Thank you.
>>>
>>>
>>>A ply is 60, so that says "if (depth <= 7)  (7*60=420)
>>
>>Craftys code uses a lot of magic numbers which makes it difficult to read
>>sometimes. Why not write "depth <= 7*INCPLY" here?
>>
>>Greetings,
>>Steffen.
>
>Speed.
>
>Calculating <421 is faster than calculating 7*INCPLY again and again.

Cmon, INCPLY is a preprocessor macro!

>If the target is to do the code more easy to understand then it is possible to
>add a comment in the code.

I prefer readable code instead of the combination magic number + explaining
comment.

Greetings,
Steffen.



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.