Fix randomInt

This commit is contained in:
Sam El-Husseini
2018-06-01 11:42:38 -07:00
parent b5814709f8
commit 6f148c14e0
61 changed files with 152 additions and 158 deletions

View File

@ -13,13 +13,13 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 1. Write the code that will store the global variable named 'action' and returns a random number between 0 and 2
```blocks
let action = Math.randomInt(3)
let action = Math.randomRange(0, 3)
```
## 2. Write the code that will display the string, "PUSH A" if the global variable called 'action' is equal to 0
```blocks
let action = Math.randomInt(3)
let action = Math.randomRange(0, 3)
if (action == 0) {
basic.showString("PUSH A", 150)
}
@ -29,7 +29,7 @@ if (action == 0) {
```blocks
input.onButtonPressed(Button.A, () => {
let action = Math.randomInt(3)
let action = Math.randomRange(0, 3)
if (action == 0) {
game.addScore(1)
}
@ -39,7 +39,7 @@ input.onButtonPressed(Button.A, () => {
## 4. Write the code that will display the string "LOGO DOWN" if the global variable called 'action' is equal to 1
```blocks
let action = Math.randomInt(3)
let action = Math.randomRange(0, 3)
if (action == 1) {
basic.showString("LOGO DOWN", 150)
}
@ -49,7 +49,7 @@ if (action == 1) {
```blocks
input.onLogoDown(() => {
let action = Math.randomInt(3)
let action = Math.randomRange(0, 3)
if (action == 1) {
game.addScore(1)
}
@ -59,7 +59,7 @@ input.onLogoDown(() => {
## 6. Write the code that will display the string "SHAKE" if the global variable called 'action' is equal to 2
```blocks
let action = Math.randomInt(3)
let action = Math.randomRange(0, 3)
if (action == 2) {
basic.showString("SHAKE", 150)
}
@ -69,7 +69,7 @@ if (action == 2) {
```blocks
input.onLogoDown(() => {
let action = Math.randomInt(3)
let action = Math.randomRange(0, 3)
if (action == 1) {
game.addScore(1)
}