added various tutorials
This commit is contained in:
@ -19,12 +19,11 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
```
|
||||
|
||||
Create a local variable of type number `x` and set it to a random number using `pick random`. `pick random` 9 generates a random number between `0` and `09`.
|
||||
|
||||
Create a local variable of type number `x` and set it to a random number using `pick random`. `pick random` 9 generates a random number between `0` and `9`.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
let x = Math.random(9)
|
||||
let x = Math.random(10)
|
||||
})
|
||||
|
||||
```
|
||||
@ -34,7 +33,7 @@ Show the random number on the screen.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
let x = Math.random(9)
|
||||
let x = Math.random(10)
|
||||
basic.showNumber(x)
|
||||
})
|
||||
|
||||
|
25
docs/lessons/guess-the-number/tutorial.md
Normal file
25
docs/lessons/guess-the-number/tutorial.md
Normal file
@ -0,0 +1,25 @@
|
||||
# guess the number tutorial
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
### @video td/videos/guess-the-number-0
|
||||
|
||||
This tutorial will help you create a guess the number game! Let's get started!
|
||||
|
||||
### ~
|
||||
|
||||
### Rebuild the game!
|
||||
|
||||
The blocks have been shuffled! Put them back together so that...
|
||||
* when the user presses button ``A``,
|
||||
* generate a random number
|
||||
* show the number on screen
|
||||
|
||||
|
||||
```shuffle
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
let x = Math.random(10)
|
||||
basic.showNumber(x)
|
||||
})
|
||||
```
|
||||
|
Reference in New Issue
Block a user