Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird random result
Message
From
05/09/2022 19:00:01
 
 
To
01/09/2022 20:11:52
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01684912
Message ID:
01684933
Views:
39
>>>I have to manage the numbers generated. For example result of rand(75) + 1 could be 1 and then result of rand(74) + 1 could also be 1. So I have to have a cursor containing humbers I don't want anymore.
>
>Got it- but also the result of RAND()*74+1 can never be 75, meaning 75 can only ever be first in the list, or never seen. The same is true of any result n that can only ever appear before position 77-n.

I quickread it elsewise - if first result is 42, array element 42 is deleted and in next loop all elements above 41 have value of nIndex+1, giving each yet undrawn number equal chance to get drawn...
Previous
Reply
Map
View

Click here to load this message in the networking platform