Let's Play Code Golf

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 23 14:11:28 PST 2015


On 2/23/15 5:04 PM, Andrei Alexandrescu wrote:
> On 2/23/15 1:30 PM, Steven Schveighoffer wrote:
>> foreach(x; stdin.byLine)
>>      writefln("%0.15f", map!(a =>
>> (a&1?-1:1)/(2.0*a+1))(iota(x.to!int)).sum);
>
> Wonder why didn't you lead with the iota? -- Andrei
>

Cuz that's how it came out my brain ;)

-Steve


More information about the Digitalmars-d mailing list