Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fiddling around with random #s and odds.
#11
wait a minute, why doesn’t this work?

Code:
dim as long n,celing
randomize timer
s = timer
celing = 2000000
do:loop until int(rnd*celing)+1 = 1234567
? done
? timer - s:sleep

also,

i ran the following code in qbasic.

Code:
RANDOMIZE TIMER
s = TIMER
celing& = 2000000
DO: LOOP UNTIL INT(RND * celing&) + 1 = 1234567
PRINT done
PRINT TIMER - s: SLEEP


it successfully found 1234567 in:

first run completed in:

3.5 seconds

second:

2) 1/5 of a second

henceforth:

3) .75 of a second

4) 3.8 seconds

----

regardless of the amount of time it took, it still worked.
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply


Messages In This Thread
Fiddling around with random #s and odds. - by Anonymous - 01-08-2007, 06:30 PM
Fiddling around with random #s and odds. - by Dio - 01-09-2007, 02:15 AM
Fiddling around with random #s and odds. - by Dio - 01-10-2007, 01:50 AM
Fiddling around with random #s and odds. - by Neo - 01-10-2007, 07:40 PM
Fiddling around with random #s and odds. - by DrV - 01-14-2007, 02:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)