Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Crafty null move question

Author: Ricardo Gibert

Date: 01:35:24 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.
>
>If the target is to do the code more easy to understand then it is possible to
>add a comment in the code.
>
>Uri

You have a serious misconception about how compilers work. Any semi-decent
compiler will produce identical code in either version. The more readable
version should be preferred.



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.