Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
There's more than one way to do things
 
PerlMonks  

Balls!

by teamster_jr (Curate)
on Mar 25, 2004 at 15:36 UTC ( #339774=obfuscated: print w/ replies, xml ) Need Help??

Hi all,
I haven't posted anything of my own for a while.
Here's my latest effort: a vt100 obfu (sorry as ever to windows users...).
The bumpmap could do with rounding and the raytracing (!) routine isn't ideal, but i'm reasonably happy with it
- maybe i'll fix these problems for an updated version at some point.
Update: I've done a new version with a generated sphere and a better shading routine. it's here.

The * at 0,0 is the lightsource.

$_=q%$_=" 88GGCI"; @a=/./g;@_=('IP ""YI','IjjjjI', 'IiciII') ;whil e($c=pop@ a){ma p{$_=$c.$_ .$c}@_ ;@_=(($t=( $n=$a[ $#a]||"@").$ {c}x(- 2+length$_[0]).$n),@_, $t)}$_='j8_4xj4,@@8b,x j2,@14bxjd@16bxd@18bx@ 20x@20x@20xY@18PxjY@16 Pxj`Y@14Pxj4`@10Pxj8"5 x';s#(.)(\d*)#$1x($2|| 1)#eg;$m=2;$n=-1;$|=1; $p=9;$q=20;{$q+=$n*= $q<11|$q>50?-1:1;$p+ =$m*=$p<8|$p>16?-1 :1;$u=-$q*6/($l=($ q**2+$p**2)**.5 );$v=-2-$p*6/$l; $r=$p-6;$ s=$q-9;$y=0 ;select$x ,$x,$x,.2*print "\ec*",(m ap{$l =0;"\e[".$ r++."; ${s}H",$y++<$v?$_:do{@ c=split//,$_[$y-$v-1]; map{$l++>$u&/@/&&($t=$ c[$l-$u-2])?$t:$_}/./g },$/}splitjx),"\e[30 H";redo}%;s#\s##g; s#j#$"#g;eval
enjoy.

alex
ps. i got the shape from http://music.hyperreal.org/artists/b12/gallery/ascii/fl/sphere.htm
The result of searching (given my job i'm not going to say googling!) for ascii art.
Update: added link to updated code

Comment on Balls!
Download Code
Re: Balls!
by flyingmoose (Priest) on Mar 26, 2004 at 14:18 UTC
    I like how the specular reflections mirror the shiny surface of my xterm. Good job!
Re: Balls!
by csuhockey3 (Curate) on Mar 26, 2004 at 18:57 UTC
    I like the ball title, but the code kind of reminded me of Mickey!
    Runs really cool too! Thanks!

    -CSUhockey3
Re: Balls!
by jZed (Prior) on Mar 27, 2004 at 01:17 UTC
    Works for me on win98 under cygwin. It's great! Thanks!
Re: Balls!
by Notromda (Pilgrim) on Mar 30, 2004 at 20:30 UTC
    All I can say is: WOW!
Re: Balls!
by belg4mit (Prior) on Apr 22, 2004 at 02:15 UTC
    That's pretty cool though IMHO it's more of a concrete poem than an obfu. We need attributes for posts :-P

    --
    I'm not belgian but I play one on TV.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://339774]
Approved by bassplayer
Front-paged by gmax
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2014-04-16 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (422 votes), past polls