From 7f4cf50ee06f2736aeb3c3486d04b258334df9dc Mon Sep 17 00:00:00 2001 From: Guillaume Jenkins Date: Thu, 2 Aug 2018 14:49:16 -0400 Subject: [PATCH] Make randomRange more consistent in docs (#1032) * Make randomRange more consistent in docs * Change formulation --- docs/reference/input/on-gesture.md | 6 +++--- docs/tutorials/getting-started.md | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/reference/input/on-gesture.md b/docs/reference/input/on-gesture.md index 7725d513..49cc4ed9 100644 --- a/docs/reference/input/on-gesture.md +++ b/docs/reference/input/on-gesture.md @@ -15,12 +15,12 @@ input.onGesture(Gesture.Shake,() => { ## Example: random number -This program shows a number from `0` to `9` when you shake the @boardname@. +This program shows a number from `2` to `9` when you shake the @boardname@. ```blocks input.onGesture(Gesture.Shake,() => { - let x = Math.randomRange(0, 10) - basic.showNumber(x, 100) + let x = Math.randomRange(2, 9) + basic.showNumber(x) }) ``` diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 8c066db9..3751e313 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -30,7 +30,7 @@ Click ``|Download|`` to save and transfer your code again, then press button **A Place some blocks to display a smiley when button **B** is pressed. -### +### Use the dropdown to find ``B``! @@ -48,15 +48,15 @@ input.onButtonPressed(Button.B, () => { ## Step 6 -Place the ``||basic:show number||`` and ``||Math:pick random||`` blocks in an ``||input:on shake||`` slot to build a dice. +Place the ``||basic:show number||`` and ``||Math:pick random||`` blocks in an ``||input:on shake||`` slot to build a dice. A typical dice can show values from 1 to 6, so don't forget don't forget to choose the right minimum and maximum values! -### +### -When the @boardname@ is shaken, a random number between ``0`` and ``6`` is displayed on the screen. +When the @boardname@ is shaken, a random number between ``1`` and ``6`` is displayed on the screen. ```blocks input.onGesture(Gesture.Shake, () => { - basic.showNumber(Math.randomRange(0, 7)) + basic.showNumber(Math.randomRange(1, 6)) }) ```