Change docs to randomInt

This commit is contained in:
Sam El-Husseini
2018-04-21 10:52:09 -07:00
parent 99a28e59f1
commit 6b9e78d269
61 changed files with 152 additions and 152 deletions

View File

@ -75,8 +75,8 @@ basic.forever(() => {
inside = 0
for (let i = 0; i < n; i++) {
// generate a point within the square
x = Math.random(r + 1)
y = Math.random(r + 1)
x = Math.randomInt(r + 1)
y = Math.randomInt(r + 1)
// test if the point is within the circle
// sqrt(x**2 + y**2) < r ==> x**2 + y**2 < r**2
if (x * x + y * y < r2) {