Monte Carlo methods: Difference between revisions
Content added Content deleted
Line 586: | Line 586: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
<lang> |
<lang>func mc n . . |
||
func mc n . . |
|||
for i range n |
for i range n |
||
x |
x = randomf |
||
y |
y = randomf |
||
if x |
if x * x + y * y < 1 |
||
hit += 1 |
hit += 1 |
||
. |
. |