Sub Calc()
2 C8 K1 y7 K; p5 V* P6 r Dim c As Long, j As Long, k As Long, p As Single
8 @& u* c" q e6 w$ A( O& n9 J Dim a As Single
% s* V1 p+ R5 u- a Dim b As Single* u# v a. e+ v" O
( i, A1 G/ P, j" K8 N8 \0 n5 G
c = Val(InputBox("")) 'If c is large enough...7 H2 K- p7 B4 d. M& {5 z
/ g2 G c7 z* `& ?
For j = 1 To c
$ ]: J& m9 H" ^+ r6 \ a = Rnd' f6 l) L l" [) b- p3 z
b = Rnd
+ @$ i. J5 C# a0 P! h If a ^ 2 + b ^ 2 <= 1 Then k = k + 1
/ L+ `4 N- a- o0 Q' n! R" V" K Next j
8 m6 q6 w: e4 q5 S 7 G$ Z, z) _. a5 p) T$ M- o! r
p = k / j * 4 'What p is...
- v& q- }4 G, G, H7 k8 DEnd Sub |