Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: A curses-based JAPH

by sgifford (Prior)
on Dec 11, 2004 at 06:30 UTC ( #414070=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Curses;use integer;@S=split(//,'Just Another Perl Hacker,');
    initscr;$C=(COLS()-@S)/2;%j=map{(LINES()/2)."/$_"=>1}($C..$C+@S-1);
    ...
    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]}}
    
  2. or download this
    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}
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2019-07-21 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (9 votes). Check out past polls.

    Notices?