Nez icon indicating copy to clipboard operation
Nez copied to clipboard

Add params variant of Choose()

Open Diamond-Wolf opened this issue 3 years ago • 1 comments

Added a new variant of Choose() which allows an arbitrary number of arguments.

Diamond-Wolf avatar Aug 10 '21 19:08 Diamond-Wolf

So, the problem with a method like this is that you pay the price of an array allocation for the params every time you call it. I'm not sure how good of an idea it is to sneak that into the API. If you have more than 4 options it is probably better to have them in an array/List/FastList and just use a random to get the index.

prime31 avatar Aug 10 '21 20:08 prime31