In creating Saturn, I started with the program I wanted, then golfed it enough to fit into the required shape.

I'd like to reduce it further and thought it might make an interesting golf. There is a precedent for this: in 1971, Alan Shepard thought the moon might make an interesting golf.

OK, so it's probably not the most interesting of golfs and is certainly longer than most. Yet if it can be significantly shortened, that leaves more space to add more visual effects and so improve the Saturn obfu. I've no idea what new effects to add yet, so if you've got some cool ideas on that score, I'd love to hear about them.

I've prepared a standalone program below that weighs in at a whopping 491 strokes (excluding newlines). Update: Score is for code before __DATA__ only, you get the shape for free in this game. (To make testing less tedious, I've shortened the delays between shapes). It's recommended it be run in a console window at least 90 chars wide by 46 deep.

This program is way too fat. Can you help it lose some weight?

sub I{s-^-$"x$_[1]-gem;$/x$_[0].$_.$/} sub D{$~=pop;system($^O=~Win?CLS:"clear"),print, select$Z,$Z,$Z,$~for@_} sub R{$i=0;join$/,map{$j=0;join"",grep!($j++%$_[0]),/./g} grep!($i++%$_[0]),@S} $S=$_=do{local$/;<DATA>}; y---c>$-and$-=y---cfor@S=/.+/g;$_.=$"x-(y---c-$-)for@S; D(@X=(I(20,41,$_="."),I(20,41,$_=O),I(15,31,$_=R 4), I(13,28,$_=R 3),I(10,20,$_=R 2),$S),.3); D((map{$n=$_;join($/,map($_ x$n,R($_)=~/.+/g),"")x$_}2..4) [0..2,1,0],.2); D$S,join("",map(reverse.$/,@S)),.1for$%..5;D reverse(@X),.3 __DATA__ + '''''' + ''''''''''' ''' +'''''''''''' '''''' +''''''''''' ''''''''' +'''''''''' ''''''''''' +''''''''' ''''''''''''' +'''''''' ~~~~~~~~~~~~~ ''''''' '' +''''''' ~~~~~~~~~~~~~~~~~~~ '''' '' +'''''' ~~~~~~~~~~~~~~~~~~~~~~~~ ''' +'''' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '''' +''' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''''' +' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '''''' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''''' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''''' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '''' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '''' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ ''' ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ''' ~~~~~~~~~~~~~ ''~~~~~~~~~~~~~~~~~~~ ''' ~~~~~~~~~~~~~~~ '''''~~~~~~~~~~~~~~~~ ''' ~~~~~~~~~~~~~~~~ '''''' ~~~~~~~~~~~~~ ''' ~~~~~~~~~~~~~~~~~ ''''' ~~~~~~~~~~ ''' ~~~~~~~~~~~~~~~~~~ '''''' ~~~~~~ ''' ~~~~~~~~~~~~~~~~~~~~ ''''''' ~~ ''' ~~~~~~~~~~~~~~~~~~~~~ ''''''' '''' ~~~~~~~~~~~~~~~~~~~~~ ''''''''' ''''' ~~~~~~~~~~~~~~~~~~~~~~ '''''''''' ''''''''' ~~~~~~~~~~~~~~~~~ '''''''''''''''''''''' ~~~~~~~~~~ '''''''''''''''''''' '''''''''''''''''' '''''''''''''''' '''''''''''''' ''''''''''' ''''''

In reply to Playing Golf on Saturn by eyepopslikeamosquito

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.