Is it possible to generate a random integer from a list of numbers or predefined set – that may not be in order.
For example – generate a random number from 1,2,4,5 (no 3 allowed).
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.
You can create an array with all your predefined set into it, then you fill an integer index with a random number from 0 to the array’s length. That should do the trick 🙂