On (23 Apr 98) David Williams wrote to Peter Dalton...
Hi David,
DW> You think the program uses the array as a set of flags, to tell when a
DW> number has already been chosen. If it were used that way, it would
ah yes, I'd never have thought of it that way, thanks.
DW> But this is precisely the kind of inefficient coding that I was intent
DW> on avoiding! As I said previously, it is virtually *never* necessary to
fair enough but I think that your program wastes time in shuffling six
numbers to the head of the queue when there's other ways to achieve the
goal.
DW> program I posted does *not* do that. The array is *not* a set of flags,
yes, I saw that.
DW> and it is *not* initially filled with zeroes. Instead it is filled with
DW> the numbers from which random ones are to be chosen - the integers 1 to
I saw that too.
DW> 49, in this case - and is manipulated so as to choose six of them at
DW> random, without any possibility of repetition.
and my program does exactly the same thing but any built in 'delays' are
in a different part of the program when compared with yours. Anyway,
what's this compulsion with speed? If everyone thought along those lines
then no-one would have bought Win95...
Success
Peter
--- PPoint 1.88
---------------
* Origin: Peter Points at last! (2:254/60.26)
|