RosettaCodeData/Task/Monte-Carlo-methods/EasyLang/monte-carlo-methods.easy
2023-09-16 17:28:03 -07:00

15 lines
227 B
Text

func mc n .
for i = 1 to n
x = randomf
y = randomf
if x * x + y * y < 1
hit += 1
.
.
return 4.0 * hit / n
.
numfmt 4 0
print mc 10000
print mc 100000
print mc 1000000
print mc 10000000