Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random Generator
Message
From
22/01/2001 22:46:49
 
 
To
22/01/2001 22:41:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00467103
Message ID:
00467108
Views:
17
>>A fun one. I want to code for a random number from 0 to 35. The challenge is to get that code in less than 6 lines (seven for a tie) as a friend of mine has demonstrated in our other language LINC. Any help will win me a beer!
>
>?int(rand() * 36)

Why don't I have to reset the RAND() after each call?

The manual says:
'RAND( ) returns the same sequence of random numbers if you use the same seed value for nSeedValue the first time you issue RAND( ) followed by subsequent RAND( ) function calls without nSeedValue.'
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform