in reply to Re: Pi golf:
in thread Pi golf:
You realize of course ... changing print to die saves 2 more, and sqrt(X) is the same as X^0.5, but the latter lets you squeeze out an extra space ...
33 chars:
$s+=6/$_**2for 1..10**6;die$s**.5
... and now that I see Tanktalus' nice suggestion above, and also realizing that map saves another space over for ...
31 chars:
map$s+=6/$_**2,1..1e6;die$s**.5
Update: Come to think of it, the number 31 is nicely appropriate, given the topic (ie. 31 = int(10 * pi))
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Pi golf:
by truedfx (Monk) on Sep 07, 2006 at 13:13 UTC | |
by liverpole (Monsignor) on Sep 07, 2006 at 14:23 UTC |