Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 64-Bit random numbers

Author: Johan de Koning

Date: 02:00:48 11/01/03

Go up one level in this thread


On October 31, 2003 at 10:27:00, Robert Hyatt wrote:

>On October 31, 2003 at 01:36:17, Johan de Koning wrote:
>
>>On October 30, 2003 at 09:44:48, Robert Hyatt wrote:
>>
>>>On October 29, 2003 at 13:39:03, Vincent Diepeveen wrote:
>>
>>>>It's like saying using 'goto' is ok in a programming environment. Where this is
>>>>certainly true, it should not be a policy to do so :)
>>>
>>>Eh?  _every_ program you write has goto's.  (aka jumps).  They are not
>>>bad.  In fact, they are _unavoidable_.
>>
>>OT1: They *are* avoidable.
>>Any finite algorithm that does not depend on mid-execution input (typically
>>time) can be written as 1 single expression. It would of course be huge and
>>run rather slowly without quantum computing.
>
>I don't know how you can possibly encode a loop into a complex expression,
>not knowing beforehand how many loop iterations will be needed...

By expanding all possibilities.
E.g. part of the WKinCheck subexpression might look like:

(
  X[e1] == WK
  &
  ( (X[f2] == BB | X[f2] == BQ)
  | (X[f2] == NOP & (X[g3] == BB | X[g3] == BQ))
  | (X[f2] == NOP & X[g3] == NOP & (X[h4] == BB | X[h4] == BQ))
  | d2, c3, etc, etc )
)
|
(
  X[f1] == WK
  etc
)
etc

I did say *huge*, didn't I ? :-)

>>OT2: You *know* what he means.
>>There's no need to remove the quotes around 'goto' and change the subject,
>>just to contradict.
>
>I happen to be one of those that believes "gotos are _not_ a bad thing."
>Yes, it is possible to "hide" them within the semantics of a programming
>language.  "break" comes to mind, as does "continue" (both in C of course.)
>But they _are_ gotos. They are implemented as jumps.  The only advantage to
>using them is that they give you a hint as to where the goto is going, without
>your having to look for a label, when reading source.  But to say that there
>are no gotos is simply wrong.  It looks like a goto.  It smells like a goto.
>It acts like a goto.  It just isn't spelled "goto".

I'm afraid everyone agrees on the use of the *keyword* goto.
Whether you like it or not.

>>BTW: this isn't personal.
>>In fact I'd advice *everyone* not to contradict Vincent.
>>That would halve the posting volume, i.e. raising the signal/noise by 6 dB. :-)
>
>If noone contradicts him, the incredible amount of disinformation he produces
>will cause at least beginners to make bad mistakes.  If they only believe 1% of
>the disinformation he produces, that is a significant number of errors that
>they will have to deal with.  I think the onus is on everyone to try to stamp
>out such errors, when possible.  IE that's what a university is all about.

If it's dangerous *and* well disguised, a contradiction might actually add to
the signal. But all other (= most) cases can safely be left as an exercise for
the reader. After all, university is about thinking.

... Johan



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.