pxt-calliope/docs/lessons/guess-the-number/tutorial.md

26 lines
475 B
Markdown
Raw Normal View History

2016-05-09 19:32:02 +02:00
# 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)
})
```