June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
5
Task/Random-numbers/Lingo/random-numbers-1.lingo
Normal file
5
Task/Random-numbers/Lingo/random-numbers-1.lingo
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
-- Returns a random float value in range 0..1
|
||||
on randf ()
|
||||
n = random(the maxinteger)-1
|
||||
return n / float(the maxinteger-1)
|
||||
end
|
||||
4
Task/Random-numbers/Lingo/random-numbers-2.lingo
Normal file
4
Task/Random-numbers/Lingo/random-numbers-2.lingo
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
normal = []
|
||||
repeat with i = 1 to 1000
|
||||
normal.add(1 + sqrt(-2 * log(randf())) * cos(2 * PI * randf()) / 2)
|
||||
end repeat
|
||||
Loading…
Add table
Add a link
Reference in a new issue