Make randomRange more consistent in docs (#1032)
* Make randomRange more consistent in docs * Change formulation
This commit is contained in:
parent
49cd197cef
commit
7f4cf50ee0
@ -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)
|
||||
})
|
||||
```
|
||||
|
||||
|
@ -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))
|
||||
})
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user