@ -34,7 +34,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Now let's add some more types of instructions for the player to follow. Let's add `PRESS PIN 0`.
|
||||
Change the global variable `action` to `math->random(4)` so that we can add a new **IF** statement that checks if `action=3`. If it does, display instructions to press pin 0.
|
||||
@ -58,7 +58,7 @@ export function newAction() {
|
||||
}
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Now let's implement `PRESS PIN 0` in the main. Create a condition of `input->on pin pressed("P0")` that will add one to the score and calls the method `new action`.
|
||||
|
||||
@ -80,7 +80,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Add `POINT ME NORTH` to the list of possible commands.
|
||||
|
||||
|
@ -10,29 +10,29 @@ Use this activity document to guide your work in the [bop it activity](/lessons/
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
### 1. Write the code that will store the global variable named 'action' and returns a random number between 0 and 2
|
||||
## 1. Write the code that will store the global variable named 'action' and returns a random number between 0 and 2
|
||||
|
||||
<br/>
|
||||
|
||||
### 2. Write the code that will display the string, "PUSH A" if the global variable called 'action' is equal to 0
|
||||
## 2. Write the code that will display the string, "PUSH A" if the global variable called 'action' is equal to 0
|
||||
|
||||
<br />
|
||||
|
||||
### 3. Write the code that increments the score if button A is pressed when the global variable called 'action' is equal to 1
|
||||
## 3. Write the code that increments the score if button A is pressed when the global variable called 'action' is equal to 1
|
||||
|
||||
<br />
|
||||
|
||||
### 4. Write the code that will display the string "LOGO DOWN" if the global variable called 'action' is equal to 1
|
||||
## 4. Write the code that will display the string "LOGO DOWN" if the global variable called 'action' is equal to 1
|
||||
|
||||
<br />
|
||||
|
||||
### 5. Write the code that increments the score if the @boardname@ logo is tilted down when the global variable called 'action' is equal to 1
|
||||
## 5. Write the code that increments the score if the @boardname@ logo is tilted down when the global variable called 'action' is equal to 1
|
||||
|
||||
<br />
|
||||
|
||||
### 6. Write the code that will display the string "SHAKE" if the global variable called 'action' is equal to 2
|
||||
## 6. Write the code that will display the string "SHAKE" if the global variable called 'action' is equal to 2
|
||||
|
||||
<br />
|
||||
|
||||
### 7. Write the code that increments the score if the @boardname@ is shaken when the global variable called 'action' is equal to 2
|
||||
## 7. Write the code that increments the score if the @boardname@ is shaken when the global variable called 'action' is equal to 2
|
||||
|
||||
|
Reference in New Issue
Block a user