Sub Calc()
7 Q% d) E# S n |+ |- q) { Dim c As Long, j As Long, k As Long, p As Single" J; W4 Q/ }; X- ^4 c4 Z
Dim a As Single
+ F5 M: y9 p, u6 _7 o2 H4 C Dim b As Single: J1 G8 Y% @0 m% v
1 D. g8 l, n* Z4 u6 Z9 D( g4 c
c = Val(InputBox("")) 'If c is large enough...
, u# m. O" u |5 e5 F
4 F( u! J# q* c1 s For j = 1 To c/ ~; h2 C+ n" T8 Y/ X
a = Rnd
0 _- ]+ @- X' w0 M8 y/ u8 y" U b = Rnd9 \; ?4 n3 k( G$ o5 _
If a ^ 2 + b ^ 2 <= 1 Then k = k + 1
3 z7 I( ~' {6 Z, J Next j2 i/ c( Y' H3 x r
6 Q8 w3 W: G" X3 n: `9 `
p = k / j * 4 'What p is.../ F* j3 M9 w% d4 i" g/ W
End Sub |