Fix randomInt

This commit is contained in:
Sam El-Husseini
2018-06-01 11:42:38 -07:00
parent b5814709f8
commit 6f148c14e0
61 changed files with 152 additions and 158 deletions

View File

@@ -21,7 +21,7 @@ We need to show a random value from 1 to 6 on our dice. So let's make a local va
```blocks
input.onGesture(Gesture.Shake, () => {
let roll = Math.randomInt(6)
let roll = Math.randomRange(0, 6)
})
```
@@ -30,7 +30,7 @@ We need a condition for if **roll** is 5. We will show a `6` if **roll** is 5 be
```blocks
input.onGesture(Gesture.Shake, () => {
let roll = Math.randomInt(6);
let roll = Math.randomRange(0, 6);
if (roll == 5) {
basic.showLeds(`
. # . # .
@@ -48,7 +48,7 @@ Let's use an `else if` condition for if **roll** is 4. If **roll** is 4 we can s
```blocks
input.onGesture(Gesture.Shake, ()=> {
let roll = Math.randomInt(6);
let roll = Math.randomRange(0, 6);
if (roll == 5) {
basic.showLeds(`
. # . # .
@@ -75,7 +75,7 @@ Now we need to repeat the same steps for if **roll** is 3. If **roll** is 3 we w
```blocks
input.onGesture(Gesture.Shake, () => {
let roll = Math.randomInt(6);
let roll = Math.randomRange(0, 6);
if (roll == 5) {
basic.showLeds(`
. # . # .
@@ -108,7 +108,7 @@ Let's also repeat these steps to show the 3, 2, and 1 on the dice. We are almost
```blocks
input.onGesture(Gesture.Shake, () => {
let roll = Math.randomInt(6);
let roll = Math.randomRange(0, 6);
if (roll == 5) {
basic.showLeds(`
. # . # .