in reply to PPGA - Prolog-Perl Golf Association: Run-length encoding
sub rle { ($c)=@_;my$i;map$c ne$_?("$i*$c",$i=1,$c=$_)[0]:++$i&&(),@_,!$_[-1] }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: PPGA - Prolog-Perl Golf Association: Run-length encoding
by mikeB (Friar) on Jul 02, 2001 at 21:14 UTC |