Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [spam?] YN golf
Knocking a few chars off yours for perl -le 'print
join$/,map{y/01/NY/;$_}map unpack("b5",chr),0..31'

and shrunk a few more by removing the join and using sprintf:

perl -le 'print map{y/10 /YN/;$_}map{sprintf"%5b$/",$_}0..31'

On Mon, Mar 31, 2008 at 3:50 PM, Uri Guttman <uri@stemsystems.com> wrote:

>
> someone posted (and it wasn't homework) for an easy way to get all
> possible combos of YN (5 chars so 32 answers). he got some basic
> multiline answers but i think it makes for a great golf problem.
>
> here is my first pass which i am sure can be easily bested. i haven't
> even squeezed out the white spaces but it does work.
>
> golf away!
>
> uri
>
> perl -le 'print join "\n", map {tr/01/NY/; $_} map unpack( "b5", chr), 0
> .. 31'
>
> --
> Uri Guttman  ------  uri@stemsystems.com  --------  [url]http://www.sysarch.com--[/ur
l]
> -----  Perl Code Review , Architecture, Development, Training, Support
> ------
> --------- Free Perl Training --- [url]http://perlhunter.com/college.html---------[/ur
l]
> ---------  Gourmet Hot Cocoa Mix  ----  [url]http://bestfriendscocoa.com---------[/ur
l]
>


Report this thread to moderator Post Follow-up to this message
Old Post
Josh Goldberg
04-01-08 04:16 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Tricks archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:42 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.