Sub Calc()
' u2 g' {9 O/ y; i" n( ? Dim c As Long, j As Long, k As Long, p As Single T5 t1 O$ P. | n5 x) A: O. ]
Dim a As Single. X' T' r' M* q* X7 ~; _
Dim b As Single
4 _" r$ X# m1 }3 r% g# F5 _' C
- Z. H- [: A2 r$ }+ S4 H6 e c = Val(InputBox("")) 'If c is large enough...
: N4 P* v- ^9 g1 ]( K 3 ~# E! L) ]6 o
For j = 1 To c
- ~% E& x/ L) E a = Rnd" q1 e T6 B& a( O2 b
b = Rnd9 }+ H3 D3 {" P
If a ^ 2 + b ^ 2 <= 1 Then k = k + 1$ x+ Y& w( n" ^2 k# e. E
Next j# Z& y2 r# C3 k1 d0 ]5 i# n
+ L- h% ?, K' @- h* E8 [8 t9 c2 y p = k / j * 4 'What p is...
- @+ Y; J; Y4 M- Z% z1 V) tEnd Sub |