Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Monte-Carlo-methods/PicoLisp/monte-carlo-methods.l
Normal file
10
Task/Monte-Carlo-methods/PicoLisp/monte-carlo-methods.l
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(de carloPi (Scl)
|
||||
(let (Dim (** 10 Scl) Dim2 (* Dim Dim) Pi 0)
|
||||
(do (* 4 Dim)
|
||||
(let (X (rand 0 Dim) Y (rand 0 Dim))
|
||||
(when (>= Dim2 (+ (* X X) (* Y Y)))
|
||||
(inc 'Pi) ) ) )
|
||||
(format Pi Scl) ) )
|
||||
|
||||
(for N 6
|
||||
(prinl (carloPi N)) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue