Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Random Generator
Message
De
22/01/2001 22:46:49
 
 
À
22/01/2001 22:41:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00467103
Message ID:
00467108
Vues:
16
>>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.'
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform