Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
IMHO, a JAPH should be short enough to fit in an email sig. Here's my attempt to compress and obfuscate your code:
use Curses;use integer;@S=split(//,'Just Another Perl Hacker,'); initscr;$C=(COLS()-@S)/2;%j=map{(LINES()/2)."/$_"=>1}($C..$C+@S-1); $x=mr(0..LINES()-1);$y=mr(0..COLS()-1);$l=mr(32..126); while(my($x,$y,$l)=(&$x,&$y,(keys%r==@S)?' ':chr(&$l))){ if($j{"$x/$y"}){next if($r{$y});$r{$y}++ if($S[$y-$C] eq $l)} addch($x,$y,$l);refresh;}sub mr{my@a=@_;sub{$a[rand @a]}}

I couldn't get it down to 4 lines, but who's picky about USENET .sig files anymore anyways? :)

Update: Turns out I'm still picky about USENET .sig files. This can be formatted into 4 80-column lines; it's formatted as 5 70-column lines here because otherwise PM wraps it into unreadability.

use Curses;@S=split(//,'Just Another Perl Hacker,');initscr;$C=int(( &COLS-@S)/2);%j=map{int(&LINES/2)."/$_"=>1}($C..$C+@S-1);($X,$Y,$L)= map{my$n=$_;sub{int rand $n}}(&LINES,&COLS,95);while(($x,$y,$l)=(&$X, &$Y,chr(32+(keys%r==@S?0:&$L)))){if($j{"$x/$y"}){next if($r{$y}); $r{$y}++if($S[$y-$C] eq $l)}addch($x,$y,$l);refresh}

In reply to Re: A curses-based JAPH by sgifford
in thread A curses-based JAPH by brian_d_foy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-25 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found