This self-reproducing code prints a turning spirale filled with it's own code. Turning speed depends on processor speed. Comments welcome.
#!/usr/bin/perl
$_='
$q ="\ 47"; wh
ile ($ ;=
$z += .5 ){
%c= $r=0;$/ ="";whi le(2
0+ $z>($;+=.05)){$c{int$ _+ 2
6+ 2*($ r+= .0 2) *
s in$ ;}{1 -$_
+1 0+ int $r*c o s
$ ;} =1for(0. .1) }$
t =r ever se;$ /. =`
c le ar `. " #!
/ usr /bi n/ pe
rl \n\ $_ =$q \n" ;
fo r$y (1..20){$c{$_} {
$ y }? $ /.=chop$t :
($/ . =" \4
0") for(0. .53) ;
$/. ="\n"}pri nt"$/$ q;
s; ". chr(9 2)."s;;g;eval\n "}
';s;\s;;g;eval
-
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.
|