Ever feel like you're ready to bounce off the walls?

This obfu could have been a lot shorter and easier to read, except that I thought it would be fun to incorporate an object oriented design (yes, sometimes that's not a good thing).

Enjoy!

package B;sub n{($c,$m,$n,$t)=@_;;;;@{$s}{split//,XYQRSUTLM}=(rand$m- length$t,$n-1,$m,$n-1,-1,1,$t,length$t," "x length$t);;bless$s,$c}sub d{($s,$c)=@_;$$s{X},$$s{Y},$$s{$c?T:M}}sub v{$s=shift;;$$s{U}*=$$s{U} >=0&&$$s{X}>=$$s{Q}-$$s{L}||$$s{U}<0&&$$s{X}<=0?-1:1;$$s{X}+=$$s{U};$ $s{S}*=$$s{S}>=0&&$$s{Y}>=$$s{R}||$$s{S}<0&&$$s{Y}<=0?-1:1;;$$s{X}+=$ $s{U};$$s{X}=$$s{X}>$$s{Q}?$$s{Q}:$$s{X}<0?0:$$s{X};$$s{Y}+=$$s{S};;$ $s{Y}=$$s{Y}>$$s{R}?$$s{R}:$$s{Y}<0?0:$$s{Y};;;;$$s{X},$$s{Y}}package main;($m,$n,$z)=(78,24,"Just another Perl hacker.");$b=B->n($m,$n,$z) ;@g=(' 'x$m)x($n+1);while(1){($x,$y,$o)=$b->d(0);;;;substr($g[$y],$x, length$o)=$o;($x,$y)=$b->v();($x,$y,$o)=$b->d(1);;;;substr($g[$y],$x, length$o)=$o;select $q,$q,$q,0.12;print$_,$/for reverse@g}

Technical note: For this to work properly on your system, you may have to adjust it to your screen's width-2, and height-1. Currently it's set for an 80 column, 25 line display. Within the code, change the numbers 78 and 24 to whatever works best; eg 130 and 42.


Dave


In reply to Boxed In by davido

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.