Modify the LED coordinates to be between 0 and 4. (#2416)
Without this change, there is a 11/36 chance no LED lights as [`Math.random(a,b)`](https://docs.python.org/2/library/random.html#random.uniform) (thus the `pick random` block) chooses a number in the (inclusive, closed) interval `[a, b]`.
This commit is contained in:
parent
af9c1e538d
commit
69b553d7bc
@ -162,7 +162,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
running = true
|
||||
led.stopAnimation()
|
||||
basic.clearScreen()
|
||||
led.plot(Math.randomRange(0, 5), Math.randomRange(0, 5))
|
||||
led.plot(Math.randomRange(0, 4), Math.randomRange(0, 4))
|
||||
}
|
||||
})
|
||||
running = false
|
||||
|
Loading…
Reference in New Issue
Block a user