Random numbers: Difference between revisions

Content deleted Content added
Eoraptor (talk | contribs)
mNo edit summary
JoeStrout (talk | contribs)
added MiniScript example
Line 1,339: Line 1,339:
Assigning a value to the special variable '''randomseed''' will allow to have always
Assigning a value to the special variable '''randomseed''' will allow to have always
the same sequence of pseudorandom numbers
the same sequence of pseudorandom numbers

=={{header|MiniScript}}==
<lang MiniScript>randNormal = function(mean=0, stddev=1)
return mean + sqrt(-2 * log(rnd,2.7182818284)) * cos(2*pi*rnd) * stddev
end function

x = []
for i in range(1,1000)
x.push randNormal(1, 0.5)
end for</lang>


=={{header|Mirah}}==
=={{header|Mirah}}==