unshmettr Posted May 4, 2022 Share Posted May 4, 2022 (edited) How do I shuffle a float array vex? Edited May 4, 2022 by unshmettr Quote Link to comment Share on other sites More sharing options...
animatrix Posted May 4, 2022 Share Posted May 4, 2022 Hi, Here is one way: int source [ ] = array ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ); float weights [ ] = array ( ); for ( int i = 0; i < len ( source ); ++i ) weights [ i ] = rand ( i + 345.2342 + i * 567.213 ); int order [ ] = argsort ( weights ); source = reorder ( source, order ); i[]@array = source; 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.