RosettaCodeData/Task/Monte-Carlo-methods/EasyLang/monte-carlo-methods.easy
2026-02-01 16:33:20 -08:00

16 lines
260 B
Text

fastfunc mc n .
for i = 1 to n
x = randomf
y = randomf
if x * x + y * y < 1 : hit += 1
.
return 4 * hit / n
.
numfmt 0 4
print mc 100
print mc 1000
print mc 10000
print mc 100000
print mc 1000000
print mc 10000000
print mc 100000000