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

@ -34,7 +34,7 @@ Here's an example mod:
```blocks
let hand = 0
input.onGesture(Gesture.Shake, () => {
hand = Math.random(3)
hand = Math.randomInt(3)
if (hand == 0) {
basic.showLeds(`
# # # # #

View File

@ -59,7 +59,7 @@ input.onButtonPressed(Button.B, () => {
basic.showNumber(p2)
})
input.onGesture(Gesture.Shake, () => {
if (Math.random(p1 + p2 - 1 + 1) + 1 <= p1) {
if (Math.randomInt(p1 + p2 - 1 + 1) + 1 <= p1) {
basic.showString("A")
} else {
basic.showString("B")
@ -118,10 +118,10 @@ let previous_roll = 0
input.onButtonPressed(Button.AB, () => {
previous_roll = 0
if (4 <= previous_roll) {
yes_or_no = Math.random(8)
yes_or_no = Math.randomInt(8)
}
if (4 > previous_roll) {
yes_or_no = Math.random(5)
yes_or_no = Math.randomInt(5)
}
if (2 < yes_or_no) {
basic.showString("YES")
@ -132,7 +132,7 @@ input.onButtonPressed(Button.AB, () => {
}
})
input.onGesture(Gesture.Shake, () => {
current_roll = Math.random(6)
current_roll = Math.randomInt(6)
basic.showNumber(current_roll + 1)
basic.pause(5000)
basic.clearScreen()