Sub Calc()
! i0 X: I5 s- s( V; Q0 G Dim c As Long, j As Long, k As Long, p As Single
7 B- }) o$ e# L+ T/ y Dim a As Single8 u2 i, N5 a+ K4 Z: P
Dim b As Single3 S7 e$ K! J% Q1 i% a+ X
0 F$ v0 I" V) a c = Val(InputBox("")) 'If c is large enough...
) l/ r1 G- n$ Z# j' c: c ' F Y" K7 Q" L5 |+ v$ k# ?
For j = 1 To c
: d8 {/ F# r D1 C a = Rnd
0 W$ V5 R$ ?8 J% Q; ` b = Rnd! R* i; H" H5 J) n" P/ ]
If a ^ 2 + b ^ 2 <= 1 Then k = k + 12 M% A! ]& } n" r6 M0 j
Next j
+ E3 Y* V1 U2 j2 R 2 }7 w% O" B1 ^" U; c0 g
p = k / j * 4 'What p is...
9 B5 x9 s+ `8 _$ x9 [3 GEnd Sub |