Migrate docs from the other repo

This commit is contained in:
Michal Moskal
2016-03-25 16:47:20 -07:00
parent 38d2cf06d2
commit a08eb53f92
895 changed files with 36888 additions and 0 deletions

View File

@ -0,0 +1,34 @@
# spinner activity
Create an arrow that randomly points to a player.
### ~avatar avatar
### @video td/videos/spinner-0
### ~
Welcome! This guided tutorial will teach how to program a script that randomly points to a player. Let's get started!
Let's begin by adding an `on shake` condition to know when the micro:bit is shaken.
![](/static/mb/blocks/lessons/spinner-0.jpg)
Now let's randomly generate a number from 0 to 3 so that we can randomly display an arrow in a given direction.
![](/static/mb/blocks/lessons/spinner-1.jpg)
Now let's handle each of the cases by displaying the appropriate arrow. (Let's display an up arrow if `random arrow` is 0.
![](/static/mb/blocks/lessons/spinner-2.jpg)
Now let's handle the rest of the cases for `random arrow`.
![](/static/mb/blocks/lessons/spinner-3.jpg)
### ~avatar avatar
Excellent, you're ready to continue with the [challenges](/microbit/lessons/spinner/challenges)!
### ~

View File

@ -0,0 +1,30 @@
# spinner challenges
Create an arrow that randomly points to a player.
## Before we get started
Complete the following [guided tutorial](/microbit/lessons/spinner/activity), your code should look like this:
![](/static/mb/blocks/lessons/spinner-3.jpg)
### Challenge 1
Modify the random number generator so that it can include new arrows we will create in the next challenge.
![](/static/mb/blocks/lessons/spinner-4.jpg)
* Do **not** run the code yet because it will not work until you have conditions for every random number.
### Challenge 2
Let's add four more arrows that point diagonally.
![](/static/mb/blocks/lessons/spinner-5.jpg)
* Run your code to see if it works as expected
### Challenge 3
Add some other arrows if there are more than 8 players.