RosettaCodeData/Task/Monte-Carlo-methods/Quackery/monte-carlo-methods.quackery
2023-07-01 13:44:08 -04:00

15 lines
381 B
Text

[ $ "bigrat.qky" loadfile ] now!
[ [ 64 bit ] constant
dup random dup *
over random dup * +
swap dup * < ] is hit ( --> b )
[ 0 swap times
[ hit if 1+ ] ] is sims ( n --> n )
[ dup echo say " trials "
dup sims 4 *
swap 20 point$ echo$ cr ] is trials ( n --> )
' [ 10 100 1000 10000 100000 1000000 ] witheach trials