Challenge to all perl gurus out there... can you make the following script any shorter?
Original (80 char) version:
$|=++$x;for(;;){$i+=$x;$x=-$x if$i>77|$i<1;print" "x$i."* \r";select$u,$u,$u,.1}
Current (58 char) version:
select$u,$u,$u,.1while$|=print" "x(abs 78-++$i%156)."* \r"
I'll permit changing the phase (starting at a different point in the cycle) because I already had to do that to get to 58, and changing the speed provided that the sleep is neither removed altogether or increased to 1s or greater. Beyond that, the output should be visually indistinguishable.
I was convinced that I couldn't get it shorter when I was at 80! Still, it really looks like it's close to optimum now - the 80 character version had lots of obvious redundancies, I just couldn't figure out how to remove them. This one doesn't.
