How can I generate a weighted random number between 1 and 10 with 10 being the highest chance and 1 being the lowest chance?
rand(1,10) ?
Needs to be a simple one line code since it will be run 100,000’s of times
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
OK I think I understand what you’re trying to say..
try this :
I looped it a million times :