in reply to Re: Pi golf:
in thread Pi golf:

++chargrill; very spiffy.

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))


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^3: Pi golf:
by truedfx (Monk) on Sep 07, 2006 at 13:13 UTC
    Actually, map doesn't save any space (nor does it cost any):
    $s+=6/$_**2for 1..1e6;die$s**.5 map$s+=6/$_**2,1..1e6;die$s**.5
      You're right... good observation.

      I still think it looks better, though, because it lets you omit the space after the for, even though that gets replaced with the ','.


      s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/