pxt-calliope/docs/reference/js/lessons/guess-the-number.md

85 lines
2.7 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# guess the number lesson
2016-04-02 01:22:47 +02:00
Learn to create a random number with input from button A.
2016-03-26 00:47:20 +01:00
### @video td/videos/guess-the-number-0
## Topic
Math - Random Numbers
## Quick links
2016-04-13 17:27:45 +02:00
* [activity](/lessons/guess-the-number/activity)
* [challenges](/lessons/guess-the-number/challenges)
* [quiz](/lessons/guess-the-number/quiz)
* [quiz answers](/lessons/guess-the-number/quiz-answers)
* [tutorial](/lessons/guess-the-number/tutorial)
2016-03-26 00:47:20 +01:00
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to create numbers randomly by using the input of the BBC micro:bit. We will be learning how to create random numbers with input using a local variable as well as simple commands, such as math->random, and show number.
## Documentation
2016-04-13 17:27:45 +02:00
* **on button pressed**: [read more...](/reference/input/on-button-pressed)
* **local variable **: [read more...](/reference/variables/var)
* **assignment operator**: [read more...](/reference/variables/assign)
* **show number**: [read more...](/reference/basic/show-number)
* **random numbers**: [read more...](/js/math)
* **clear screen**: [read more...](/reference/basic/clear-screen)
2016-03-26 00:47:20 +01:00
## Objectives
* 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
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Understands that iteration is the repetition of a process such as a loop. (AL)
* Represents solutions using a structured notation. (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
* Declares and assigns variables.(AB)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
2016-04-13 17:27:45 +02:00
* [activity](/lessons/guess-the-number/activity)
* [tutorial](/lessons/guess-the-number/tutorial)
* [quiz](/lessons/guess-the-number/quiz)
2016-03-26 00:47:20 +01:00
## Extended Activity
* time: 20 min.
2016-04-13 17:27:45 +02:00
* [challenges](/lessons/guess-the-number/challenges)
2016-03-26 00:47:20 +01:00
## Homework
2016-04-13 17:27:45 +02:00
* Extended Activity: [challenges](/lessons/guess-the-number/challenges)
2016-03-26 00:47:20 +01:00