Random generation from predefined values?

Hi, I know it is possible to create with Random 1 100 but how do you create by randomly selecting pre-defined values e.g.

Create a box by randomly selecting 50 100 150 or 200 for the length.

cheers, K

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mjbg's picture

you can create an array with

you can create an array with the lengths you want and use it to create the box

something like this:

_arrayLengths = #(50,100,150,200) -- desired length
 
Box length:_arrayLengths[random 1 _arrayLengths.count] width:100 height:100

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.