Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Balls! Pt 2

by teamster_jr (Curate)
on Apr 06, 2004 at 13:32 UTC ( #342916=obfuscated: print w/ replies, xml ) Need Help??

Hi all, Apologies for posting something so similar to my previous effort, but the code is completely different in this one -
  • it doesn't use VT100 codes (except \ec which i think works everywhere),
  • everything is generated (except the shading scale) - compared with it being encoded in this
    theoretically you could make a new shape (along the lines of $x**2+$y**2+$z**2<$r**2 - which is used here)and it would work with that...
  • it actually uses closest path shading to the lightsource
It's also 1 ball of code shorter (a standard i intend to start using - 1 ball =~ 200 chars :-D ).
anyway, without further ado:

$_=q`$_=' @8GCI';@a=/./g; $j=9;$k=9;$w=25;$ c=35;$e= 8;$u=2;$v=1;{$k+=$v* =$k<6|$k>16?-1: 1;$j+=$u*=$j<9|$j>60?- 1:1;my(%l,$m,$n); for$y(0..22){for(0..70 ){$r=($_-$j)/1.6;$s= $y-$k;$d=(($_-$c)**2+( $y-$f)**2+(($w-$r**2-$ s**2)**.5-$e)**2)**.5; if($r**2+$s**2<$w){$m= $d<$m||!$m?$d:$m;$n= $d>$n?$d:$m;$l{$y}{$_} =$d;}}}print"\ec"; for$y(0..22){print$_>6 9?$/:(($d=$l{$y }{$_})?$a[($d-$m)*5/ $n]:$")fo r(0..70)}select$q, $q,$q,.1;redo}`; s#\s##g;eval
Enjoy!
Alex

Comment on Balls! Pt 2
Download Code
Re: Balls! Pt 2.
by McMahon (Chaplain) on Apr 06, 2004 at 17:58 UTC
    More balls! More balls!
      Personally I think they look more like tits. But yay tits!
Re: Balls! Pt 2.
by u235sentinel (Hermit) on Apr 09, 2004 at 20:16 UTC
    Believe it or not, I sent this to a buddy of mine who is alot more experienced with Perl than I am. We tried running it but no dice (had a couple of errors during the run). I simply did a copy/paste btw.

    What exactly is this supposed to do?

    (Yes... I play a Perl noobie in R/L and T.V. ::grinz::)

      sorry to hear that - it should just work with copy and paste, but you can right click on download code and save it - then do perl index.pl (although i think ie adds some stuff that you might have to edit out).
      good luck with it.
      a

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (17)
As of 2015-07-01 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (9 votes), past polls