How about sorting the elements and binning them together until the distance between the first element in the bin and the next element is larger than 1000?
If ou want to optimize for a minimal number of bins or something like that, you will need to put more thought into that. There is lots of literature for "good" binning, but if you only care about the distance between elements, the naive approach should get you far.
If you show us the relevant code you already have, we can maybe give you more concrete advice.
In reply to Re: Stuck with manipulating an array
by Corion
in thread Stuck with manipulating an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |