How would I assign a random number using rand or another function if I want the range to be between 0 to 16?
Hi @ts22
Try the formula:
rand() * 16
The expression rand() generates a number between 0 - 1 so just multiply by 16, and set the data type as Int32 or something, so that there are no decimals.
If you want Double to be your Data type, then use something like ceil(rand() * 16) instead.
Hope that helps.
- Andrew
Thank you, I appreciate it!
Is there a way to use RandInt and not have it assign duplicate values? I noticed it will give me two 8's instead of just a singular 0-16 for each number.