¿ªÔÆÌåÓý

Re: Random number between two numbers in range


 

You can get clever with 1dX+Y, e.g.
{Dice~1d1501+499} will give 500-2000

It's a "fencepost problem." The count of 500 to 2000 is 1501 rather than 1500. Likewise 2000-5000 has a count of 3001 rather than 3000, and 5000-10000 has a count of 5001 rather than 5000.

Erol K. Bayburt
ErolB1@...

On 2/3/2021 7:51 AM, jimmyflowers1 via groups.io wrote:
I have a table with various values on each item in the table list. For example, 500-2000, 2000-5000, 5000-10000, etc.
Is there some syntax I can use to basically say pick a random number between 500 and 2000? I've managed to get some of the values by doing 1dX+Y, but the problem I run into is when the value exceeds that and I can't put a cap on it. Any suggestions?

Join [email protected] to automatically receive all group messages.