Tuesday, December 12, 2017

Select random item from a list

Select random item from a curated collection.

My_selection=sel_rnd( [1, 3, 0.5, 100, sin(2)]  );

function sel_rnd(v)=v[floor(rnd(len(v)))];

 

No comments:

Post a Comment