Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

3D JAPH II (animated)

by Chady (Priest)
on Jul 30, 2001 at 23:22 UTC ( [id://100928]=obfuscated: print w/replies, xml ) Need Help??

Following my first 3D JAPH, I decided I should animated it a bit. and here it is, 3D JAPH II

system calls to clear the screen were very slow, so I decided to use print, and this is only tested on Windows and on the perlmonk.org server;

  • Windows dos prompt will scroll if I print 23 lines
  • I tried with perlmonk.org, it scrolls for 22 lines.
I just hope the lines won't move a lot on other platforms.

#!/usr/bin/perl -w # The 3d JAPH II (animated) by Chady Kassouf use strict; #10~10~51~100~32~74~97~112~104~44~32~98~121~32~67~1 #04~97~100~121~32~75~97~115~115~111~117~102~46~10~84~104~97~110 #~120~32~102~111~114~32~119~97~116~99~104~105~110~103~46~10~10~ $|++; for(1..5){my $n= 6-$_;print &t($n); sleep 1;} my @all;$/= ';'; while (my $l= <DATA>){$l =~s/[ ;\n]//g;my$l1;foreach my $i (split(/:/,$l)){if($i=~/^0(\d+)$/) {my $s = 0 x$1; $l1.=$s}else {$l1.=$i}}push@all,$l1} &cls;foreach my $l2(@all){ &cls if ($l2 eq '-');$_ = "\n";foreach my $ch(split(//,$l2)){$ch=~tr{0-9A-L} {_^~@#BC%e(GK\/OQ3RSs6t7}; print $ch;} print;} sleep 3;$/="\n"; open D,$0;chomp(my@c = <D>);close D;my($r,$u)=split('#',$c[1]); $u .= substr $c[2],1,length($c[2]); $u .=substr $c[3],1,length( $c[3]); foreach (split(/~/,$u)){ print pack("C", $_);} sub cls{ select (undef,undef,undef,0.315);} sub t{ my $n = shift; return "You have $n seconds to step away from the screen.\r";}__DATA__ 072;072;072;053:33:017;045:33333335533KKK:013;036:333333333:02: 53KKK3355K:015;028:E3:06:E53IKKK333KK55KK3533K:015;018:A333:05: EHEHEK:03:65555KBG53KK33KK3333K:015;015:533333333K:02:HHEHKK:03 :63555KGHHEKK55KKKK53K:015;017:3KKKKK:03:HEHHHDKK:02:75535K333K K553KL5535K:015;017:353GKK:03:EHHHK3BKK:02:333GKK:03:3535K33H3D K:015;017:5335KK:02:HHEEEL33KK:02:535HK:02:3333E5K3:02:KK:016;0 18:533KK:02:HEEEK333KKKBG35IK:05:5KK:022;018:533KK:02:HHEEK9333 3KK33EKK3K:028;012:E333:02:555KK:02:HEEK:02:333EKKK3K:032;012:B HB3KKE45KK33GEHK3:03:K:038;012:3GEKKKBHHKK:02:3KKK:043;014:3K33 35KK:050;016:KKKC:052;072;072;072;072;072;-;072;072;072;055:DD: 015;045:33333333333LKKL:012;027:3:06:333333333LKK:02:3I3KK3333K L:013;014:3333333:05:4444K:05:3333KK4333KL333K:02:333KK:013;013 :33333LKKK:04:444KK:05:3333K94GG5KK333K33333LL:013;015:336KK:05 :4444KKK:04:3333KI3G44KK333KKKLL3L:014;016:33KK:05:444K33KK:03: 3333K433KK:02:333K:02:333L:014;016:33KK:04:4444K33KK:03:3333K:0 6:3334K34333L:014;016:33KK:04:444K3333KK:02:3333K:04:333437L:02 :33KKL1:012;011:3:04:53KK:03:444DKKK233KK33G33K:06:33KLL:020;09 :44333:02:35KK:02:4444K:02:3333KKK3338KKK:029;09:9G4KKK445KK133 G4KK3:02:G33KKKK:035;010:3KKK63G4KK:02:33KKKKK:043;011:7K3333KK :053;014:1:057;072;072;072;072;072;072;-;072;072;072;072;035:33 333333:03:3333333493399999:010;011:33333333:07:552:07:3222992G7 99:02:3399:02:33399:012;012:92222222:05:55522:06:33399:02:33399 33399:02:33399:012;014:3222:07:552222:05:33399:02:5539933399333 3399:012;014:3922:06:55K2322:05:333993335F9:02:33999999999:012; 014:H322:05:5552:02:322:04:333999999:02:E33399:02:33399:012;015 :322:05:5523333222:03:33399:06:333399:02:33399:012;09:33:04:322 :04:55522222222:03:33399:05:33533993333G993:011;08:5333:03:322: 04:552:05:339233333993:05:3399999:018;08:32222:02:322:02:35G523 :03:33329933D99999:029;09:233335522:02:2382222:03:2:041;010:233 322C:055;072;072;072;072;072;072;072;072;072;-;072;072;072;072; 059:L:012;011:H333333:07:G53:06:3333GD9CCCC:02:K3222222:02:G222 22:09;011:CCCCCCC1:06:5CC:08:33CC:03:33CCC33322:03:33322:011;01 4:CC:08:55CCC:07:33CC:03:533C233322:03:33322:011;014:CC:08:5C:0 2:CC:06:33CC:03:G55C23332233333322:011;014:CC:07:55C:02:CCC:05: 33CC3333522:02:332222222222:011;014:CC1:05:55C3333CC:05:33CC:08 :33322:03:33322:011;08:533:03:CCC:05:5CC3ICCCCC:04:33CC:08:3332 2:03:33322:011;07:GCC3:03:CCC:04:55C:06:CCC:03:53CC:06:3335322: 02:335322C:010;07:CCCC:02:GCCC:03:5GC33:03:335CC33335CC33:06:32 22222:02:22:013;07:C33335GCC:03:33CCC3:03:HCCCCCCCCC2:033;08:CC CCCCC:057;072;072;072;072;072;072;072;072;-;072;072;072;072;025 :K:013:1C:06:BG3333G:02:333333I:09;010:CCCCCCCC:07:CC:09:2CCC:0 3:DCCC:02:33CCC:03:333CC:010;013:CC3:08:GCCC:08:3CCC:04:3CCC:02 :3CC1:03:333C2:010;013:CC3:08:C:02:CC:07:3CCC:03:H3CCC:02:3CC:0 4:333C2:010;013:CC3:07:GC:02:CC:07:3CCC:02:GGGCC:02:33CC3333333 22:010;013:CC3:06:GC:04:CC:06:3CCCCCCCCC:03:33CC:04:33322:010;0 8:33:03:CC3:06:CK3333CCC:05:3CCC:09:33CC:04:33322:010;07:CC33:0 2:CCH:05:GC:06:CC:05:3CCC:09:33CC:04:33322:010;06:CCCC:03:CCG:0 4:EC:08:CC:04:3CCC:07:33G3CCK:02:33G322:010;06:C33333DCC:04:GCC 33:04:33CCC3333CCC9C:06:3CCCCC2:02:322222C:08;07:1CCCCCC:05:CCC 1:049;072;072;072;072;072;072;072;072;072;072;-;072;072;072;072 ;09:LLLLKKKK3:07:K3:07:KKKKKKKKLLL:02:33LLLLLLL33L7L7777:07;012 :LL33:08:KKK:09:3KK:04:HLLL:03:3LL:05:33377:09;012:LL33:07:KKKK 3:08:3KK:05:3LL:03:3LL:05:33377:09;012:LLL3:07:KD:02:K3:07:3KL: 05:3LL:03:3LL:05:33377:09;012:LLL3:06:K3:02:KKKC:06:3LLFA333LL1 :02:63LLI6FF777777:09;012:LLL3:05:1LAEG3LLK:06:3LL2CCC:06:33LL: 05:33H77:09;06:LLL33:02:LL3:05:LLLLLLLLL3:05:3LL:010:33LL:05:33 777:09;05:LLLL3:02:LLL3:04:L3:06:LLLK:04:3LL:010:33L7:05:3377F: 09;06:L333:02:LL3:04:3L333:03:33LLL33336LL33:06:3333773:02:3333 7F5:09;07:LLLLLL:05:LLLLL3:03:LLLLLLLLLLLLLL:07:3L77777L:02:77F FFFF:07;072;072;072;072;072;072;072;072;072;072;-;072;072;072;0 24:C3:046;012:CC332:07:CC3:09:11:05:111:04:311:06:331C:09;012:C C33:07:CCC33:08:11:06:111:03:311:06:331C:09;012:CC33:06:CD3CC3: 08:C1:06:111:03:311:06:33CC:09;012:CC33:06:C3:02:CC3:07:CC:05:G 11:04:311:06:33CC:09;012:CC33:05:C33:02:CC33:06:CCCC11111:05:31 111111CCCCC:09;07:7333:02:C33:04:CCCCCCCCC3:06:CC:012:311:06:33 CC:09;05:CCCC33:02:C33:04:C39:04:CCC3:05:CC:012:3CC:06:33CC:09; 05:13333:02:CC33:03:CA3:06:CCG3:04:CC:012:3CC:06:3ECC:09;06:CC3 32CC3:03:2CCC233:02:33CCCD333CCC333:07:33CCC33:02:333CCC36:07;0 72;072;072;072;072;072;072;072;072;072;072;-;072;072;072;010:22 2CCC33:05:CC33:05:CCCCCC7DICCC:03:33CCC933:02:333CCC33:07;012:2 C333:06:CCD3:08:CC3:05:CCC:04:CC:07:9CCC:09;012:2C333:05:C3CC33 :07:CC3:05:CCC9:03:CC:07:7CCC:09;012:CC333:04:CA32CC33:06:CC3:0 5:CCC:04:CC:07:7CCC:09;012:2C333:04:C33:02:C33:06:CC3:03:1CC9:0 5:CCCCCCCCCCCCC:09;012:2C333:03:C333:02:CC33:05:CC3:012:CC:07:I CCC:09;06:222333CC333:03:C33:03:CCC33:04:CC3:012:CC:07:ACCC:09; 06:2223332C333:02:C333:04:CC33:04:CC3:012:CC:07:8CCC:09;06:2333 322G33:02:CC333:05:CC33:03:CC3:012:CC:07:4CCC:09;08:222B:05:1CC CCC:02:CCCCCCCCCCCCCCC:07:CCCCCCCC:02:3CCCCCCC:07;072;072;072;0 72;072;072;072;072;072;072;072;-;072;072;061:CCC:08;023:1:07:99 992222222:04:2CCCCH33:02:C33CCC33:08;010:9999933337:02:C9733:06 :3223333JK223:03:CCC3:07:CCC:010;012:993333:04:999333:06:2233:0 4:2223:02:1CC3:07:CCC:010;012:993333:03:93G9933:06:9233:04:2223 :02:1CC3:07:CCC:010;012:993333:03:93399333:05:2233:03:22233:02: 1CCCCCCCCCCCCC:010;012:993333:02:9333399333:04:2222222333:05:CC 3:07:CCC:010;012:993333:02:9999999K33:04:2233:011:CC3:07:CCC:01 0;07:99933993333:02:333:03:99333:03:2233:011:CC3:07:CCC:010;07: 7333899333F99333:04:99331:02:2233:011:CC3:07:CCC:010;07:9933993 33K99995333999999992222233:06:CCCCCCCCF:02:CCCCCCCC:07;072;072; 072;072;072;072;072;072;072;072;072;-;072;072;054:CCCCCCCCC:09; 038:C1:04:CCCCC3335:02:33CCC5335:08;023:23:05:2HCCC33333CC3:03: 3CC553:05:CCC5:011;011:222233355:02:22333:05:CCC555:02:CCC33:02 :CC55:06:CCC5:011;013:225555:02:2522333:04:CCC555:02:CCC55A:02: C55:06:CCC5:011;013:225555:02:2522333D:03:CCC555:02:CC335:02:CC CCCCCCCCCCC5:011;013:295555:02:55522333:03:CCCCCCCC4333:03:CC53 333333CCC5:011;013:2F5555:02:55522G333:02:CCC553D:08:CC55:06:CC C5:011;09:C:03:2H555522226322333:02:CCC555:09:CC55:06:CCC5:011; 08:2255G25555525555:02:22333:02:CC555:09:CC55:06:CCC5:011;08:23 3322355523335:03:223334CCC335:08:CCCCCC:03:CCCCCCCC5:08;09:2222 333I2222555KD43333333333333:032;072;072;072;072;072;072;072;072 ;072;072;-;072;072;059:4:012;052:999993334:011;042:999993334:02 :399944333:010;030:99999339993:03:99944G3:03:99944:013;022:933: 06:994433399953:02:99444:04:99944:013;012:99993344:02:993333:03 :994444:02:9944G999444:04:99944E:012;014:944444:02:993333:03:99 4444:02:9G4449999999999999444:012;014:944444:02:4993333:02:9944 4999335GG9994333333999444:012;014:944444944693333:02:9953333333 3:02:999444:04:299444:012;014:94444444E9993333:02:94444:07:9994 44:05:99444:012;010:1:03:9444494333693333:02:94444:07:299444:05 :99444:012;09:994499444E44444:02:93333994444:06:1999994:02:9999 999944I:09;09:933G9E44499333D999999999994444:05:33333333:020;01 0:999333334333333:047;072;072;072;072;072;072;072;072;000000000

He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

Replies are listed 'Best First'.
Re: 3D JAPH II (animated)
by Trimbach (Curate) on Jul 31, 2001 at 06:24 UTC
    Very cool. ++

    Just FYI it works just peachy under Mac OS X, especially if you set the terminal window to 22 or 23 lines using "Shell->Inspector"

    Gary Blackburn
    Trained Killer

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://100928]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found