Click here to get back home

every combination of Y/N in 5 positions

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
every combination of Y/N in 5 positions joemacbusiness 03-31-2008
Posted by Mirco Wahab on April 1, 2008, 7:17 am
Please log in for more thread options
Gunnar Hjalmarsson wrote:
> I'm not a golfer, but it's easy to write obfuscated code using Perl...
> perl -le"dofor(0..0b11111)"

Much too wordy ;-)

perl -e' print "$_\n" while glob""x5'


Regards

M.

Posted by John W. Krahn on April 1, 2008, 8:30 am
Please log in for more thread options
Mirco Wahab wrote:
> Gunnar Hjalmarsson wrote:
>> I'm not a golfer, but it's easy to write obfuscated code using Perl...
>> perl -le"dofor(0..0b11111)"
>
> Much too wordy ;-)

I concur.

> perl -e' print "$_\n" while glob""x5'

perl -le'print for glob""x5'



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Posted by Abigail on April 1, 2008, 9:32 am
Please log in for more thread options
_
John W. Krahn (someone@example.com) wrote on VCCCXXVII September MCMXCIII
-: Mirco Wahab wrote:
-: > Gunnar Hjalmarsson wrote:
-: >> I'm not a golfer, but it's easy to write obfuscated code using Perl...
-: >> perl -le"dofor(0..0b11111)"
-: >
-: > Much too wordy ;-)
-:
-: I concur.
-:
-: > perl -e' print "$_\n" while glob""x5'
-:
-: perl -le'print for glob""x5'

Saving 3 chars:

perl -E'say for glob""x5'


Abigail
--
$"=$,;*}}=*_;
sub _ {push @_ => /::(.*)/s and goto &{ shift}}
sub shift {print shift; @_ and goto &}
Hack ("Just", "Perl ", " ano", "er\n", "ther "); # 20080401

Posted by Willem on April 1, 2008, 9:43 am
Please log in for more thread options
Abigail wrote:
) _
) John W. Krahn (someone@example.com) wrote on VCCCXXVII September MCMXCIII
) -: Mirco Wahab wrote:
) -: > Gunnar Hjalmarsson wrote:
) -: >> I'm not a golfer, but it's easy to write obfuscated code using Perl...
) -: >> perl -le"dofor(0..0b11111)"
) -: >
) -: > Much too wordy ;-)
) -:
) -: I concur.
) -:
) -: > perl -e' print "$_\n" while glob""x5'
) -:
) -: perl -le'print for glob""x5'
)
) Saving 3 chars:
)
) perl -E'say for glob""x5'

perl -e'print glob""x5'

But this is nicer:

perl -e'$,="\n";print glob""x5'


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT

Posted by Abigail on April 1, 2008, 9:52 am
Please log in for more thread options
_
Willem (willem@stack.nl) wrote on VCCCXXVII September MCMXCIII in
?? Abigail wrote:
?? ) _
?? ) John W. Krahn (someone@example.com) wrote on VCCCXXVII September MCMXCIII
?? ) -: Mirco Wahab wrote:
?? ) -: > Gunnar Hjalmarsson wrote:
?? ) -: >> I'm not a golfer, but it's easy to write obfuscated code using
Perl...
?? ) -: >> perl -le"dofor(0..0b11111)"
?? ) -: >
?? ) -: > Much too wordy ;-)
?? ) -:
?? ) -: I concur.
?? ) -:
?? ) -: > perl -e' print "$_\n" while glob""x5'
?? ) -:
?? ) -: perl -le'print for glob""x5'
?? )
?? ) Saving 3 chars:
?? )
?? ) perl -E'say for glob""x5'
??
?? perl -e'print glob""x5'

But that doesn't print newlines after each entry.

?? But this is nicer:
??
?? perl -e'$,="\n";print glob""x5'


But this subthread involves a golfed solution, not a nice necessarely a
nice one...



Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'

Similar ThreadsPosted
Looking for combination.pm June 29, 2005, 10:56 pm
Perl + Objects = Winning combination April 9, 2007, 7:55 pm
Perl Developer Positions in California March 11, 2005, 12:53 pm
htaccess rewriterule in combination with POST form January 28, 2005, 12:38 am
How can I add tokens at arbitrary positions on a line in a file? August 13, 2005, 6:36 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap