Fix randomInt
This commit is contained in:
@ -22,7 +22,7 @@ Now let's randomly generate a number from 0 to 3 so that we can randomly display
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.randomInt(4)
|
||||
let randomArrow = Math.randomRange(0, 4)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -41,7 +41,7 @@ Now let's handle each of the cases by displaying the appropriate arrow. (Let's d
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.randomInt(4)
|
||||
let randomArrow = Math.randomRange(0, 4)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -69,7 +69,7 @@ Now let's handle the rest of the cases for `random arrow`.
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.randomInt(4)
|
||||
let randomArrow = Math.randomRange(0, 4)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
|
Reference in New Issue
Block a user