7 lines
165 B
Text
7 lines
165 B
Text
fcn monty(n){
|
|
4.0 * (1).pump(n,Void,fcn(r){
|
|
x:=(0.0).random(1); y:=(0.0).random(1);
|
|
if(x*x + y*y < 1.0) r.inc();
|
|
r
|
|
}.fp(Ref(0)) ).value/n;
|
|
}
|