in reply to Golf -- compute PI
Using $_ instead of $p is a nice try to save two strokes, but it fails because for(1..9){..} aliases elements of the range to $_, which overwrites your later use of $p. Good job, though.
Cheers, Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
$n=3;$s=1;for(1..9){$n*=2;$s=(2-(4-$s**2)**.5)**.5;$\=$n*$s}print [download]
$@=3;$;=1;$@*=2,$;=(2-(4-$;**2)**.5)**.5,$\=$@*$;for 1..9;print [download]
-Blake