Try
running
this
in
an
xterm
window!
#!/usr/bin/perl -w
sub d($){defined($ _[ 0])}sub p( $){print @_}sub r
($$) {int $_[0]+rand($_ [1]-$_[0 ]+1)}$|=
016; my$a =2;sub c{p"\e" ."[H";;p "\e[J";}
open (Y,$0) ;my( @y,$y) ;for (;;)
{&d( $y=(<Y>) ) or last;; push @y ,
$y.( ' ' x80 )} $SIG{INT}= sub{c;exit};c;my
$b=0 ;;; for(; ;){my($r,$c) =(r(1,@y),r(1,80
));; my$k=(substr($ y[$r- 1],$ c-1,
1));; ;;;; printf"\e[%d;". "%d". "H". "\e"
."[1" .";" ."7;" ."%s" ."m". "%s" ."".
"\e[0m",$r, $c,r(30, 37),$k if $k ne" "; }return; ;__END__;
__Just_ _Another_ PerlHacker by_John_C _Norton_ 8/17/2005
Downloadable code:
#!/usr/bin/perl -w
sub d($){defined($ _[ 0])}sub p( $){print
+ @_}sub r
($$) {int $_[0]+rand($_ [1]-$_[0
+ ]+1)}$|=
016; my$a =2;sub c{p"\e" ."[H";;p
+ "\e[J";}
open (Y,$0) ;my( @y,$y) ;for
+ (;;)
{&d( $y=(<Y>) ) or last;; push
+ @y ,
$y.( ' ' x80 )} $SIG{INT}= sub{c;exi
+t};c;my
$b=0 ;;; for(; ;){my($r,$c) =(r(1,@y)
+,r(1,80
));; my$k=(substr($ y[$r- 1],$
+ c-1,
1));; ;;;; printf"\e[%d;". "%d". "H".
+ "\e"
."[1" .";" ."7;" ."%s" ."m". "%s"
+ ."".
"\e[0m",$r, $c,r(30, 37),$k if $k ne" "; }return;
+;__END__;
__Just_ _Another_ PerlHacker by_John_C _Norton_
+8/17/2005
"download section" added by holli
-
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.
|