pxt-calliope/docs/reference/js/lessons/the-hat-game/quiz.md

60 lines
1.2 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# the hat game quiz
2016-04-02 01:22:47 +02:00
The all famous Hat Game -- one of 3 hats has the ball, which is revealed at the beginning. The hats then swap with each other. You goal is to choose the hat with the ball after the hats have finished swapping.
2016-03-26 00:47:20 +01:00
## Name
## Directions
2016-04-13 17:27:45 +02:00
Use this activity document to guide your work in the [the hat game tutorial](/lessons/the-hat-game/tutorial)
2016-03-26 00:47:20 +01:00
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. What is the name of the first function you created? What does it do?
<br/>
## 2. Write a for loop that plots the points (0, 2), (2, 2), and (4, 2).
<br/>
## 3. How can you increase the difficulty of the game?
<br/>
## 4. Consider the following code
```
cupSelect = "LMR"
index = -1
```
Write the code that displays the next letter of the string in "cup select" when button A is pressed.
<br/>
<br/>
<br/>
<br/>
<br/>
## 5. Write the line of code that shows the swapping animation of two hats swapping if hat 1 = 0 and hat 2 = 2.
<br/>
## 6. Consider the following code
```
let not = Math.random(3)
```
Given the hat we are not going to swap, how can we calculate the other two hats that we are going to swap? Use these two values to call "swap hats()" with a swap speed of 50.
<br/>
<br/>