On Mon, Dec 10, 2001 at 04:36:26PM +0100, BooK wrote:
> En r�ponse � [EMAIL PROTECTED]:
>
> > IMHO a solution to a good hole should be in the 50-70 char region. That way
> > there's more scope for "styling" the response. Such styling could
> > include:
> > - the least number of /a-z/i chars.
> > - the largest number of times a chosen bonus character is used
> > - inefficiency of the algorithm
> >
> > My particular favourite is how "sorted" the code is
> >
> > $code="for(0..9)print";
> > @chars = map {ord($_)} split //, $code;
> > for ($x=0; $x+1 < @chars;$x++) {
> > $score++ if ($chars[$x]<$chars[$x+1]);
> > }
> > print $score
>
> You mean (supposing the code is in $_, and $score is in $s):
>
> $o="\xff";for(split//){$s++if($_>$o);$o=$_};print$s
>
> Mmm. This might not work (or compile): I do not have a perl here.
> (I tried other things to obfuscate the algorithm, and then I remembered
> I was at work. Oops.)
You're using a numeric comparison on strings. :)
$s+=$<$1while/.(?=(.))/gs;print$s
Ronald