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:
Asher Kach 2019-09-10 09:20:32 -05:00 committed by Peli de Halleux
parent af9c1e538d
commit 69b553d7bc

View File

@ -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