Grasshopper

algorithmic modeling for Rhino

I am trying to split a list of integers into "runs", basically consecutive recurrences of the same integer.  For example, 2,2,0,0,2,2,2,2 would be spit into three lists, (2,2) (0,0), (2,2,2,2).  I want to be able to measure the length of each of these lists.  I hope this makes sense. 

Thanks,

David

Views: 2927

Replies to This Discussion

Attachments:

Thank you, that is genius.

David

There's actually a bit more to it as I didn't realise it was dropping the last run of numbers.

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service