I managed to get it down to 61 bytes.... I'm still humbled by some of the other submissions....for(1..999999){$x=rand();$y=rand();$k++if sqrt($x*$x+$y*$y)<1}print 4* +$k/999999
for(1..1e6){$k++if sqrt(rand()**2+rand()**2)<1}print $k*4/1e6
In reply to Re: Golf -- compute PI
by lhoward
in thread Golf -- compute PI
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |