Monte Carlo methods: Difference between revisions

Content added Content deleted
Line 1,023: Line 1,023:
=={{header|EasyLang}}==
=={{header|EasyLang}}==
<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
proc mc n . .
func mc n .
for i = 1 to n
for i = 1 to n
x = randomf
x = randomf
Line 1,031: Line 1,031:
.
.
.
.
print 4.0 * hit / n
return 4.0 * hit / n
.
.
numfmt 4 0
numfmt 4 0
call mc 10000
print mc 10000
call mc 100000
print mc 100000
call mc 1000000
print mc 1000000
call mc 10000000
print mc 10000000
</syntaxhighlight>
</syntaxhighlight>
Output:
Output: