From 69b553d7bcf3e429ae3cf8cae830e2745b55f0a6 Mon Sep 17 00:00:00 2001 From: Asher Kach Date: Tue, 10 Sep 2019 09:20:32 -0500 Subject: [PATCH] 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]`. --- docs/projects/reaction-time/code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/projects/reaction-time/code.md b/docs/projects/reaction-time/code.md index cfe3b049..4a572805 100644 --- a/docs/projects/reaction-time/code.md +++ b/docs/projects/reaction-time/code.md @@ -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