This code has a "feature" that is truly random. How many letters of JAPH will you get?
#!/usr/local/bin/perl use strict;my@l=(1);my($c,$d )=(75,0);push@l,q|-84|;sub t{my$o=shift ;print$o @_}push@l,qw{-1 43 -2};unshift@l,@l[$#l- 2..$#l];pop@l;pop@l;pop@l;sub c{my$f=pop;open M,$f;my @l=<M>;chomp@l;pop@l while$l[$#l]ne'__END__';open M, ">$f";t *M,(join"\n",@l),$/}push@l,qw-33 45 1 5-;push @l,qw @-12 -3@;sub i {my(@a ,$n)= @_;$n+=shift@a while $n++, @a&&!--$a[0];{ @a|| last; @a=($a[0]<$n?$ a[0]: $n,@a );($n-=$a[0])&& redo} @a}unshift@l,qw[13 -82];push@l,@l[0,1];shift@l;shift@ l;sub P{my($P,$p)=@_;$P<$p?0:$P==1||$p==1||$P-$p==1?1 :P($P-1,$p-1)+P($P-$p,$p)}push@l,qw-48 21 13-,q;-6;; $l[$#l+1]=-76;push@l,qw/40 25 2 8/,q#-6#;sub p{my$e; my@r=[];$e=$_,@r=map{my@a=@$_;map[@a[0..$_-1],$e,@a[ $_..$#a]],0..@a}@r for@_;@r}push@l,qw@13 -104@;if(my @t=unpack"C*",do{local($/);<DATA>}){my$t=0;{$t[0]==126 ?((t *STDERR,chr$t),last):($t+=shift@t)and redo}c $0; $d=$t[$#t];$c+=$l[$_]for 0..$d}else{$c+=$l[0];$d=0}if ($d<@l){open M,">>$0";my@p=$c;my$r;do{$r=int(rand&P($ c,int(rand($c-($ c/3))+1)+int(2* $c/3)))+1}while $r==1;@p=i@p while$r--;(@p <1<<3)?(@p=p( @p)and t(* M,(map{chr} @{$p[int( rand(0+@ p))+1]}), '~',chr($ d+1))) :(t(*M, (map{chr }@p) ,'~', chr( $d +1) )) ;exec"perl $0"} __END__
Enjoy,
jynx

PS it looks better in fixed-width font ;-)


In reply to Number Theory Monster by jynx

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.