Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
(Golf) showing runsby nop (Hermit) |
on Jun 27, 2001 at 22:46 UTC ( [id://92039]=perlquestion: print w/replies, xml ) | Need Help?? |
nop has asked for the wisdom of the Perl Monks concerning the following question:
Can anyone suggest a golfish way to take a sorted array like @a = (1,2,3,4, 55, 101,102,888) and produce a list of singles and runs (a run is 3 or more conseq integers) like this: 1-4, 55, 101, 102, 888 My solution is ugly and long. Thanks. nop
Back to
Seekers of Perl Wisdom
|
|