forked from algorithm-archivists/algorithm-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonte_carlo.emojic
54 lines (43 loc) · 1.4 KB
/
monte_carlo.emojic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
🐇 ☝️ 🍇
🖍🆕 x 💯
🖍🆕 y 💯
🆕 🍼 x 💯 🍼 y 💯 🍇 🍉
❗️ 📪 ➡️ 💯 🍇
↩️ x
🍉
❗️ 📫 ➡️ 💯 🍇
↩️ y
🍉
🍉
🐇 🌕 🍇
🖍🆕 radius 💯
🆕 given_radius 💯 🍇
🏧 given_radius❗️ ➡️ 🖍radius
🍉
❗️ 📥 point ☝️ ➡️ 👌 🍇
📪 point❗️ ➡️ point_x
📫 point❗️ ➡️ point_y
↩️ 🤜point_x ✖️ point_x ➕ point_y ✖️ point_y🤛 ◀️ 🤜radius ✖️ radius🤛
🍉
🍉
🐇 🤡 🍇
🐇 ❗️ 🏃♀️ samples 🔢 ➡️ 💯 🍇
🆕🌕🆕 1.0 ❗️ ➡️ circle
0 ➡️ 🖍🆕 count
🆕🎰🆕 ❗️ ➡️ random
🔂 i 🆕⏩⏩ 0 samples❗️ 🍇
🆕☝️🆕 💯 random❗️ 💯 random❗️❗️ ➡️ point
↪️ 📥 circle point❗️ 🍇
count ⬅️ ➕ 1
🍉
🍉
↩️ 4.0 ✖️ 💯 count❗️ ➗ 💯samples❗️
🍉
🍉
🏁 🍇
😀 🔤Running with 10,000,000 samples.🔤❗️
🏃♀️🐇🤡 10000000❗️ ➡️ pi_estimate
😀 🍪🔤The estimate of pi is: 🔤 🔡 pi_estimate 10❗🍪❗️
🏧 🤜pi_estimate ➖ 🥧🕊💯 ❗️🤛❗️ ➗ 🥧🕊💯 ❗️ ✖️ 100 ➡️ percent_error
😀 🍪🔤The percent error is: 🔤 🔡 percent_error 10❗ 🔤%🔤🍪❗️
🍉