Submit an Entry

To enter the challenge, you need to signup or login.

This Challenge's Best Entries [View All]

(View the Overall | Perl | PHP | Python | Ruby

Rank User Size Language Score [?]
1st primo 54 Ruby 10,000 (v29)
2nd jojo 54 Ruby 10,000 (v26)
3rd carldr 54 Ruby 10,000 (v5)
4th flagitious 54 Ruby 10,000 (v5)
5th Mark Byers 54 Ruby 10,000 (v23)
6th shinh 54 Ruby 10,000 (v37)
7th marmalade 54 Ruby 10,000 (v8)
8th leonid 54 Ruby 10,000 (v28)
9th dmd 54 Ruby 10,000 (v40)
10th ozy4dm 57 Ruby 9,473 (v14)

See who is active in this challenge →

1,000 Digits Of Pi

(Challenge added almost 7 years ago.)

Calculate the first 1,000 digits of Pi.

The Problem

I'm sure all of you have encountered Pi at some point or another, but I doubt many of you have tried calculating it. For this challenge, your code needs to calculate the first 1,000 digits of Pi (Not including the 3 at the start!) For reference, you can see the output we're expecting below.

There are various methods of calculating Pi, and part of the challenge will be deciding on one which is quick enough and allows you to write the smallest code. As usual, Wikipedia's Pi page is a good starting point, but be sure to make good use of Google too.

Good luck with it! Remember the IRC channel (#codegolf on irc.freenode.net) and the Forums are there if you run into difficulty!

More Information

  • Your code needs to match the below output by printing to stdout. No input will be given to your code.
  • Remember there is a 4-second execution limit for your code. Any code which runs for longer than 4 seconds will be deemed to have failed.

View the required output →