Eugene van der Pijll schreef op 22 februari 2002:
> #!/usr/bin/perl -l
> [pop=~/.(?{$a=$a*36-55+$&=~y#0-9##*7+ord$&})/g];print$a
> (58)

I don't recall seeing a single entry in any of the 4 golf
games that successfully used this technique. In the Get Even
post mortem, Ton suggested to try to find a variant of:

-p /[aeiouy]?(?{$_ x=1&~$.&split$&})/

that doesn't coredump, but did not provide a working solution.

For cheap thrills, I whittled Eugene's 58 to 52.

#!/usr/bin/perl -l
[pop=~/.(?{$a=$a*36+(ord(lc$&)-9)%39})/g];print$a

There is at least one person on this list (Japhy) who truly
understands all the intricacies of (?{...}) but I certainly
don't. For example, why do you need the [] ?

Curiously, Eugene's 58-er works on Perl 5.6.1 but fails on 5.6.0,
while my whittled 52-er passes both versions. I don't know why.

/-\ndrew

Reply via email to