2016-03-25 16:47:20 -07:00
# guess the number lesson
2016-04-01 16:22:47 -07:00
Learn to create a random number with input from button A.
2016-03-25 16:47:20 -07:00
## Topic
Math - Pick Random
## Quick links
2016-04-13 08:27:45 -07:00
* [activity ](/lessons/guess-the-number/activity )
2016-05-09 10:32:02 -07:00
* [tutorial ](/lessons/guess-the-number/tutorial )
2016-04-13 08:27:45 -07:00
* [challenges ](/lessons/guess-the-number/challenges )
* [quiz ](/lessons/guess-the-number/quiz )
* [quiz answers ](/lessons/guess-the-number/quiz-answers )
2016-03-25 16:47:20 -07:00
## Prior learning/place of lesson in scheme of work
2016-11-01 10:42:42 -07:00
Learn how to create numbers randomly by using the input of the @boardname @. We will be learning how to create random numbers with input using a local variable as well as simple commands, such as pick number and show number.
2016-03-25 16:47:20 -07:00
## Documentation
2016-04-04 22:33:13 -07:00
```cards
input.onButtonPressed(Button.A, () => {})
2016-03-29 15:59:00 -07:00
let x = 0
basic.showNumber(0)
2018-06-01 11:42:38 -07:00
Math.randomRange(0, 3)
2016-03-29 15:59:00 -07:00
basic.clearScreen()
```
2016-03-25 16:47:20 -07:00
2016-03-29 15:59:00 -07:00
## Objectives
2016-03-25 16:47:20 -07:00
2016-03-29 15:59:00 -07:00
* learn how to run code when an input button is pressed
* learn how a variable is a place where you can store data
* learn how to set the value of a local variable
* learn how to returns a random number
* learn how to show a number on the LED screen, one digit at a time (scrolling left to right)
* learn how to turn off all the LED lights on the LED screen