Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Triangle Golf

by jmcnamara (Monsignor)
on Apr 24, 2001 at 17:14 UTC ( #75037=note: print w/replies, xml ) Need Help??

in reply to Triangle Golf

This was attempt to see if using format() would be shorter. It wasn't. It does use some of Perl's dustier artifacts however:
#!/usr/bin/perl -wall -00n use strict; END{ @_=shift@F; while(@F){ $_=shift @F; $_.=' '.shift@F while(length$_<=length$_[-1]&&@F); push@_,$_ } formline(('@'.('|'x80)."\n")x@_,@_); print $^A }

Update: Using MeowChow's regex this can be reduced to 89 chars + 6 command line switches. I'm not proud of this:
#!/usr/bin/perl -w -00nal use strict; END{ $_="@F "; @F=1; formline'@'.('|'x80)."\n",$&and@F=length$&while/.{1,@F}.*? /g; print$^A }


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://75037]
[LanX]: Socrates was a Troll
[Your Mother]: It's very, very dangerous... Thinking that a group is intrinsically evil... buries the fact that all humans can be so deep that it starts to become likely they will be.
[Your Mother]: LanX++
[Corion]: (also the "troll for trolls sake" could seen be much like the "punk for punks beer")
[Your Mother]: I'm completely (historically anyway) a troll in real life. It's not fun online, you can't really win. :P
Happy-the-monk orders a Punk IPA.
[Your Mother]: Also, I'm too old to start fights with strangers anymore.
[LanX]: concentrating on omestic violence?
[LanX]: d
[Your Mother]: Open air violence. Or on campus.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (22)
As of 2018-03-19 13:47 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.