Grasshopper

algorithmic modeling for Rhino

Hi,

Is it possible to use function  System.Random.Range(i, list.length) ?

When I type System.Random I cannot access Range.

I would like just to shuffle items in a list similar to this:

  1. for (int i = 0; i /span> alpha.Count; i++) {
  2. string temp = alpha[i];
  3. int randomIndex = Random.Range(i, alpha.Count);
  4. alpha[i] = alpha[randomIndex];
  5. alpha[randomIndex] = temp;
  6. }

Thanks,

Petras

Views: 1813

Replies to This Discussion

PS: This no attachment possible recent behavior is nerve braking

Attachments:

Thanks :)))

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service