Re: Processing numbers in random order



Maybe #2 was not thought through... but why is #1 incorrect?

Is it not possible to be at index 10 and request a random number from 1-10
and end up swapping 10 with 10?

Phil
----

"Arthur T." <arthur@xxxxxxxxxxxxxx> wrote in message
news:sclgm393hhvu5knqq34gjr22287s9pedaa@xxxxxxxxxx
In Message-ID:<47684e61$0$8430$afc38c87@xxxxxxxxxxxxxxxxxxxx>,
"Phil" <obrienpw@xxxxxxxxxxxxxxx> wrote:

I made changes to:
1) Not include the value of index i in the random number search - this
will
result in only replacing itself.

Making it less random because it's impossible to have a
number in the top half which doesn't move.

2) Stop half way on the assumption that if the top half of the array has
been toggled then the bottom half must also be done.

Making it *much* less random by greatly increasing the chance
that a number in the bottom half won't move.

#1 seemed likely on inspection and was confirmed by printing
the tables. I expected some problem with #2 and printing the
output showed the above problem.

--
Arthur T. - ar23hur "at" intergate "dot" com
Looking for a z/OS (IBM mainframe) systems programmer position


.



Relevant Pages

  • Re: [SLE] Envelopes in OpenOffice
    ... > Format to DL. ... > printer without printing anything. ... the address is printed right at the bottom of it. ... > settings box to DL, each time I want to print an envelope. ...
    (SuSE)
  • RE: How do I get large images to print in Publisher-created webpag
    ... with the address and date of course at the bottom. ... on each page for freindly printing. ... > opens the image file. ... >>> pages but you dumb the design down to have no images and you change the site ...
    (microsoft.public.publisher.webdesign)
  • Re: Phone logs
    ... Both compile and run but the Phone test shows incorrect info! ... Here is the link to the code downloaded from MSDN http://msdn.microsoft.com/msdnmag/issues/04/10/NET/ go to the bottom of this page and you will see the code link. ...
    (microsoft.public.pocketpc.developer)
  • Re: Problem while printing two Simultaeous documents
    ... i am printing the postscript document from the command line like lpr ... The problem is, after invoking the first request, the printer prints ... The "lpr" command you mentioned ... i tried printing the postscript document with cntrl-D. ...
    (comp.lang.postscript)
  • Risc World CD Magazine
    ... Steve Fryatt wrote: ... It's rather like previewing before printing from ... or bottom an orphaned line of dots that were the very top or bottom of a ... with the exception of those orphaned dots. ...
    (comp.sys.acorn.misc)

Loading