Posted: Tue Nov 06, 2007 11:33 am
See also this thread: http://www.purebasic.fr/english/viewtopic.php?t=24890
http://www.purebasic.com
https://www.purebasic.fr/english/
I only ran it once and kind of guessed at 20 seconds, thinking about it, it was probably a lot shorter than that.blueznl wrote:I shouldn't do these things, but I actually did a number of runs in the background, debugger on, and doing some forum browsing at the same time... and they average out at 11 seconds hereDerek wrote:Still took 20 seconds on my fast processor.srod wrote:down to the shear speed of today's processors I reckon!Code: Select all
Repeat Until Random(100000000) = 10 Debug "Located 10 !"
It won't, because the numbers aren't actually random.srod wrote:Aye, very nice.
In theory though, this method could lock up, forever in seach of that last 'free' element!![]()
But that's 1 in 100000000. I just require 1 in 100.That fact that it doesn't lock up is quite surprising; down to the shear speed of today's processors I reckon! Kind of like the following which I would expect to run for a long long time before finishing :
Code: Select all
Repeat Until Random(100000000) = 10 Debug "Located 10 !"