Change docs to randomInt
This commit is contained in:
@ -22,7 +22,7 @@ Now let's randomly generate a number from 0 to 3 so that we can randomly display
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.random(4)
|
||||
let randomArrow = Math.randomInt(4)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -41,7 +41,7 @@ Now let's handle each of the cases by displaying the appropriate arrow. (Let's d
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.random(4)
|
||||
let randomArrow = Math.randomInt(4)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -69,7 +69,7 @@ Now let's handle the rest of the cases for `random arrow`.
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.random(4)
|
||||
let randomArrow = Math.randomInt(4)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
|
@ -8,7 +8,7 @@ Complete the following [guided tutorial](/lessons/spinner/activity), your code s
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.random(4)
|
||||
let randomArrow = Math.randomInt(4)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -46,7 +46,7 @@ Modify the random number generator so that it can include new arrows we will cre
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.random(8)
|
||||
let randomArrow = Math.randomInt(8)
|
||||
if (randomArrow == 3) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -89,7 +89,7 @@ Let's add more arrows that point diagonally.
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomArrow = Math.random(8)
|
||||
let randomArrow = Math.randomInt(8)
|
||||
if (randomArrow == 7) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
|
@ -15,7 +15,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
|
||||
<br/>
|
||||
|
||||
```blocks
|
||||
let randomArrow = Math.random(4)
|
||||
let randomArrow = Math.randomInt(4)
|
||||
```
|
||||
|
||||
## 2. Write the if statement that will display this down arrow from your code. Hint- This occurs if the local variable 'random arrow' returns 1.
|
||||
@ -25,7 +25,7 @@ let randomArrow = Math.random(4)
|
||||
<br/>
|
||||
|
||||
```blocks
|
||||
let randomArrow = Math.random(4);
|
||||
let randomArrow = Math.randomInt(4);
|
||||
if (randomArrow == 1) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
@ -44,7 +44,7 @@ if (randomArrow == 1) {
|
||||
<br />
|
||||
|
||||
```blocks
|
||||
let randomArrow = Math.random(4);
|
||||
let randomArrow = Math.randomInt(4);
|
||||
if (randomArrow == 2) {
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
|
Reference in New Issue
Block a user