Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Re: Competition fuels obsession over Perl [golf]

by eyepopslikeamosquito (Canon)
on Feb 19, 2004 at 21:13 UTC ( #330359=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Competition fuels obsession over Perl [golf]
in thread Competition fuels obsession over Perl

For the "less than ten vowels" version, you can also lose one by getting rid of that space after the "map{9-".

Alas, Perl complains with Unrecognized file test: -y if you try that. However, using your lc trick saves two more strokes:

print+map{/./;9-$&.$'}sort map{9-lc=~y/aeiou//." $_\n"}@F

You could allow up to 90 vowels (at the cost of 3 strokes) by changing 9 to 99 and . to ..


Comment on Re: Re: Re: Re: Competition fuels obsession over Perl [golf]
Select or Download Code
Re: Re: Re: Re: Re: Competition fuels obsession over Perl [golf]
by educated_foo (Vicar) on Feb 19, 2004 at 22:29 UTC
    Hm... "9-y///" works fine on 5.8.3 for me, while 5.6.0 chokes. Nothing jumps out at me in perldelta, but it does mention that parsing of m// has changed.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://330359]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-07-03 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls