If the circle had a radius of 1, it would have an area of π and the square around it would have an area of 4. The ratio of the area of the circle to the area of the square (π/4) is around 0.785. This means that we can multiply the quotient of the number of dots in the circle divided by the total number of dots by 4 to get pi. According to the law of large numbers, the more dots placed, the more accurate it is to pi. More details here: https://en.wikipedia.org/wiki/Monte_Carlo_method
Use Turbo Mode (Shift+Click Green Flag) for really fast speeds!