Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I realized that I was doing way too much in the open, so playing around with the encoding mechanism I had gave me the following code (presented here, for your enjoyment).

#!/usr/bin/perl -w use strict; use Term::ANSIScreen; $| = 1; my %config = ( delay => 0.1, width => 75, looptimes => 10 ); my (@characterline); foreach my $i ( 0 .. 8 ) { push @characterline, ' ' x 226; } while ( my $line = <DATA> ) { while ( $line =~ m/(.)(.)(.{2})/g ) { substr( $characterline[ hex($2) ], hex($3), 1, $1 ); } } my $console = Term::ANSIScreen->new; { $console->Cls(); foreach my $i ( 0 .. ( $config{looptimes} - 1 ) ) { foreach my $x ( 0 .. length( $characterline[0] ) ) { $console->Cursor( 1, 1 ); foreach my $y ( 0 .. $#characterline ) { print substr( $characterline[$y] x 2, $x, $config{width} ), "\n"; } select undef, undef, undef, $config{delay}; } } } __DATA__ J002J003J004J005J006h051h052l090l091l092l093h0a2h0a3k0bdk0beJ104 J105h151h152l191l192h1a2h1a3k1bdk1beJ204J205s212s213s214s215s216 t21dt21ea22ea22fa230a231a232o241o242o243t24at24bh251h252e25be25c e25de25er263r265r266r267r268p275p276p278p279p27ae27fe280e281e282 r287r289r28ar28br28cl291l292h2a2h2a3a2aca2ada2aea2afa2b0c2b6c2b7 c2b8k2bdk2bek2c1k2c2e2c7e2c8e2c9e2car2cfr2d1r2d2r2d3r2d4J304J305 u309u30au30du30es312s313t31bt31ct31dt31et31ft320a332a333n336n338 n339n33an33bo33fo340o344o345t348t349t34at34bt34ct34dh351h352h353 h354h355e35ae35be35ee35fr363r364r368r369p375p376p377p37be37ee37f e382e383r387r388r38cr38dl391l392h3a2h3a3h3a4h3a5h3a6a3b0a3b1c3b4 c3b5k3bdk3bek3c0k3c1e3c6e3c7e3cae3cbr3cfr3d0r3d4r3d5J404J405u409 u40au40du40es412s413s414s415s416t41dt41ea42ea42fa430a432a433n436 n437n43bn43co43fo440o444o445t44at44bh451h452h455h456e45ae45be45c e45de45ee45fr463r464p475p476p477p47be47ee47fe480e481e482e483r487 r488l491l492h4a2h4a3h4a6h4a7a4aca4ada4aea4b0a4b1c4b4c4b5k4bdk4be k4bfk4c0k4c1e4c6e4c7e4c8e4c9e4cae4cbr4cfr4d0J501J502J504J505u509 u50au50du50es516s517t51dt51ea52da52ea532a533n536n537n53bn53co53f o540o544o545t54at54bh551h552h555h556e55ae55br563r564p575p576p578 p579p57ae57ee57fr587r588l591l592h5a2h5a3h5a6h5a7a5aba5aca5b0a5b1 c5b4c5b5k5bdk5bek5c0k5c1e5c6e5c7r5cfr5d0J602J603J604u60au60bu60c u60es612s613s614s615s616t61et61ft620a62ea62fa630a632a633n636n637 n63bn63co641o642o643t64bt64ct64dh651h652h655h656e65be65ce65de65e e65fr663r664p675p676e67fe680e681e682e683r687r688l692l693l694h6a2 h6a3h6a6h6a7a6aca6ada6aea6b0a6b1c6b6c6b7c6b8k6bdk6bek6c1k6c2e6c7 e6c8e6c9e6cae6cbr6cfr6d0p775p776

Update 2007-01-27: Removed one configuration and one left-over variable. Placed remaining three into a single hash, and updated code to use hash. Updated loop to prepare @characterline array. Updated loop to use the number of items in @characterline.

Update 2007-01-27: Changed routine loading from DATA to use a regex rather than multiple substr() calls.

In reply to Re: JAPH attempt using Term::ANSIScreen - redux by atcroft
in thread JAPH attempt using Term::ANSIScreen - redux by atcroft

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (10)
    As of 2017-10-20 13:22 GMT
    Find Nodes?
      Voting Booth?
      My fridge is mostly full of:

      Results (263 votes). Check out past polls.