Sub Calc()
9 y( Y% F1 V7 E- d) |: \! A Dim c As Long, j As Long, k As Long, p As Single
! g& j3 F/ e/ X! q Dim a As Single6 d q+ ~, K- s5 @9 \
Dim b As Single
2 y' X; y# d3 J% M6 ^ i- U% [! y6 m Y% p
c = Val(InputBox("")) 'If c is large enough...
/ e4 E6 T) H- \0 z$ E6 Z
1 `$ P4 _* |: m8 O, `( E For j = 1 To c/ y! P& \- Z; p& ?3 _
a = Rnd3 N4 _, u5 [3 l* T% V
b = Rnd0 U- w! P! r3 M# e, ^2 b$ I
If a ^ 2 + b ^ 2 <= 1 Then k = k + 1; u. N) e, P" o/ O; `- f5 ]
Next j
3 W6 S, F+ P0 {9 `6 ? 5 G, D/ ]. @+ ?7 `, @
p = k / j * 4 'What p is...
" A5 g: N6 i }, h; ZEnd Sub |