in reply to Monte Carlo approximation of PI
UPDATE: yes, this is very much an attempt at humor. :O) No disrespect meant to you or my new favorite app framework, POE. ;)use strict; use warnings; use POE; my $in = 0; my $count = shift || 1000; POE::Session->create( inline_states => { _start => sub { rand () ** 2 + rand () ** 2 < 1 && $in ++ }, }, ) for 1 .. $count; POE::Kernel->run(); printf "Pi equals %f\n", 4 * $in / $count;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Monte Carlo approximation of PI
by Abigail-II (Bishop) on Apr 04, 2003 at 20:53 UTC | |
by Anonymous Monk on Apr 05, 2003 at 05:43 UTC |