Fix randomInt
This commit is contained in:
@ -8,7 +8,7 @@ Complete the following [guided tutorial](/lessons/spinner/activity), your code s
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.randomInt(4)
|
||||
let randomArrow = Math.randomRange(0, 4)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -46,7 +46,7 @@ Modify the random number generator so that it can include new arrows we will cre
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.randomInt(8)
|
||||
let randomArrow = Math.randomRange(0, 8)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -89,7 +89,7 @@ Let's add more arrows that point diagonally.
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.randomInt(8)
|
||||
let randomArrow = Math.randomRange(0, 8)
|
||||
if (randomArrow == 7) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
|
Reference in New Issue
Block a user