Change docs to randomInt
This commit is contained in:
@ -34,7 +34,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen()
|
||||
let randomNumber = Math.random(3)
|
||||
let randomNumber = Math.randomInt(3)
|
||||
|
||||
});
|
||||
```
|
||||
@ -47,7 +47,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen();
|
||||
let randomNumber = Math.random(3);
|
||||
let randomNumber = Math.randomInt(3);
|
||||
if (randomNumber == 2) {
|
||||
basic.showString("YES");
|
||||
}
|
||||
@ -63,7 +63,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen()
|
||||
let randomNumber = Math.random(3)
|
||||
let randomNumber = Math.randomInt(3)
|
||||
if (randomNumber == 2) {
|
||||
basic.showString("YES")
|
||||
} else if (randomNumber == 1) {
|
||||
@ -79,7 +79,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen()
|
||||
let randomNumber = Math.random(3)
|
||||
let randomNumber = Math.randomInt(3)
|
||||
if (randomNumber == 2) {
|
||||
basic.showString("YES")
|
||||
} else if (randomNumber == 1) {
|
||||
@ -101,7 +101,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen()
|
||||
let randomNumber = Math.random(3)
|
||||
let randomNumber = Math.randomInt(3)
|
||||
if (randomNumber == 2) {
|
||||
basic.showString("YES")
|
||||
} else if (randomNumber == 1) {
|
||||
|
@ -11,7 +11,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen()
|
||||
let randomNumber = Math.random(2)
|
||||
let randomNumber = Math.randomInt(2)
|
||||
if (randomNumber == 2) {
|
||||
basic.showString("YES")
|
||||
} else if (randomNumber == 1) {
|
||||
@ -35,7 +35,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen()
|
||||
let randomNumber = Math.random(4)
|
||||
let randomNumber = Math.randomInt(4)
|
||||
if (randomNumber == 2) {
|
||||
basic.showString("YES")
|
||||
} else if (randomNumber == 1) {
|
||||
@ -59,7 +59,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen()
|
||||
let randomNumber = Math.random(4)
|
||||
let randomNumber = Math.randomInt(4)
|
||||
if (randomNumber == 3) {
|
||||
basic.showString("TRY AGAIN")
|
||||
} else if (randomNumber == 2) {
|
||||
@ -82,7 +82,7 @@ basic.showString("ASK A QUESTION")
|
||||
basic.showNumber(8)
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.clearScreen()
|
||||
let randomNumber = Math.random(4)
|
||||
let randomNumber = Math.randomInt(4)
|
||||
if (randomNumber == 4) {
|
||||
basic.showString("DEFINATELY")
|
||||
} else if (randomNumber == 3) {
|
||||
|
@ -19,13 +19,13 @@ An if statement will conditionally run code depending on whether or not a condit
|
||||
## 2. Create a Variable called ``x`` and assign it to a random number between 0 and 2.
|
||||
|
||||
```blocks
|
||||
let x = Math.random(3)
|
||||
let x = Math.randomInt(3)
|
||||
```
|
||||
|
||||
## 3. Write the 'if statement' to check if ``x`` is equal to 2. Inside the 'if statement', display the string "Yes".
|
||||
|
||||
```blocks
|
||||
let x = Math.random(3)
|
||||
let x = Math.randomInt(3)
|
||||
if (x == 2) {
|
||||
basic.showString("Yes", 150)
|
||||
}
|
||||
@ -34,7 +34,7 @@ if (x == 2) {
|
||||
## 4. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No."
|
||||
|
||||
```blocks
|
||||
let x = Math.random(3)
|
||||
let x = Math.randomInt(3)
|
||||
if (x == 2) {
|
||||
basic.showString("Yes", 150)
|
||||
} else if (x == 1) {
|
||||
@ -45,7 +45,7 @@ if (x == 2) {
|
||||
## 5. Write the code to display the string "I don't know" if the Variable ``x`` is neither 2 nor 1.
|
||||
|
||||
```blocks
|
||||
let x = Math.random(3)
|
||||
let x = Math.randomInt(3)
|
||||
if (x == 2) {
|
||||
basic.showString("Yes", 150)
|
||||
} else if (x == 1) {
|
||||
|
@ -15,7 +15,7 @@ The blocks have been shuffled! Put them back together so that...
|
||||
```shuffle
|
||||
basic.showString("ASK A QUESTION")
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
let randomNumber = Math.random(3)
|
||||
let randomNumber = Math.randomInt(3)
|
||||
if (randomNumber == 2) {
|
||||
basic.showString("YES")
|
||||
} else if (randomNumber == 1) {
|
||||
|
Reference in New Issue
Block a user