Topicm94456c77ed3affbd_1528449000663_0Topic

Number guessing game

Levelm94456c77ed3affbd_1528449084556_0Level

Second

Core curriculumm94456c77ed3affbd_1528449076687_0Core curriculum

Grades IV‑VI

I. Understanding, analyzing and solving problems. The student:

2) formulates and writes in the form of algorithms commands consisting of:

c) controlling the robot or object on the screen;

3) distinguishes basic steps in algorithmic problem solving: determination of the problem and goal to be achieved, analysis of the problem situation, developing a solution, checking the problem solution for example data, writing the solution in the form of a diagram or program.

II. Programming and solving problems with the use of computer and other digital devices. The student:

1) designs, creates and writes in a visual programming language:

a) ideas of stories and solutions to problems, including simple algorithms using sequential, conditional and iterative commands and events,    
b) a simple program that controls a robot or other object on the computer screen;

Timingm94456c77ed3affbd_1528449068082_0Timing

45 minutes

General objectivem94456c77ed3affbd_1528449523725_0General objective

Creates a program using randomrandomrandom numbers.

Specific objectivesm94456c77ed3affbd_1528449552113_0Specific objectives

1. Uses conditional instructions.

2. Creates algorithms for imaginary stories.

3. Enters data into the program.

Learning outcomesm94456c77ed3affbd_1528450430307_0Learning outcomes

The student:

- builds programs using randomrandomrandom numbers,

- applies conditional and sequential instructions.

Methodsm94456c77ed3affbd_1528449534267_0Methods

1. Discussion.

2. Work with computer.

Forms of workm94456c77ed3affbd_1528449514617_0Forms of work

1. Individual work.

2. Group work.

Lesson stages

Introductionm94456c77ed3affbd_1528450127855_0Introduction

Children often play in guessing. One of the games is guessing the number or objects that the other person has in mind.

Your task is to write a script in which the computer „invents” a number, and you guess it. The rules are simple – determine the range of numbers between which the number is looked for. If the number you choose is too small or too large, you enter the next one. The game lasts so long until you guess the number.

Before writing a script, ask the other person to play the game together. Write down your answers and discuss what would be important for the algorithm of your script.

Procedurem94456c77ed3affbd_1528446435040_0Procedure

Before you start writing a script, learn how to communicate with the sprite. Blocks from the Sensing and Operators category are helpful in communication.

Task 1

Build a script in which the sprite will ask you for your name and then use it to greet you.

Solution:

[Illustration 1]

One of the conditions of the game in guessing numbers is choosing any number by the program. For this purpose, it draws numbers in the range given to him. The random operator pick random ... to ... is useful here. In addition to this, you will need a variable to which you will assign the drawn number.m94456c77ed3affbd_1527752256679_0One of the conditions of the game in guessing numbers is choosing any number by the program. For this purpose, it draws numbers in the range given to him. The random operator pick random ... to ... is useful here. In addition to this, you will need a variable to which you will assign the drawn number.

Task 2

Build a script in which the program draws a number from 1 to 20. The drawn number has to be shown on the screen. The sprite says if the number is smaller or greater than 10.

Then change the script so that the upper boundupper boundupper bound of the draw numbers depends on your choice.

You can compare your solutionsolutionsolution with the one on the slideshow. It shows how to test the program.

[Slideshow]

Task 3

Using your previous scripts, build a script to play the game of guessing numbers.

Add selected backdrop.

You can add a countercountercounter of correct answers or scored pointsscored pointsscored points.

Lesson summarym94456c77ed3affbd_1528450119332_0Lesson summary

A useful function of the program is to draw numbers from the selected range.m94456c77ed3affbd_1527752263647_0A useful function of the program is to draw numbers from the selected range.

Selected words and expressions used in the lesson plan

countercountercounter

lower boundlower boundlower bound

randomrandomrandom

scored pointsscored pointsscored points

solutionsolutionsolution

upper boundupper boundupper bound

variablevariablevariable

m94456c77ed3affbd_1527752263647_0
m94456c77ed3affbd_1527752256679_0
m94456c77ed3affbd_1528449000663_0
m94456c77ed3affbd_1528449084556_0
m94456c77ed3affbd_1528449076687_0
m94456c77ed3affbd_1528449068082_0
m94456c77ed3affbd_1528449523725_0
m94456c77ed3affbd_1528449552113_0
m94456c77ed3affbd_1528450430307_0
m94456c77ed3affbd_1528449534267_0
m94456c77ed3affbd_1528449514617_0
m94456c77ed3affbd_1528450135461_0
m94456c77ed3affbd_1528450127855_0
m94456c77ed3affbd_1528446435040_0
m94456c77ed3affbd_1528450119332_0
random1
random

losowy

R1Yb7IuqnalFb1
wymowa w języku angielskim: random
upper bound1
upper bound

górna granica

R18F1n1SJzLSr1
wymowa w języku angielskim: upper bound
solution1
solution

rozwiązanie

R11VE1rupjfSa1
wymowa w języku angielskim: solution
counter1
counter

licznik

R9yYBwIPtR1FE1
wymowa w języku angielskim: counter
scored points1
scored points

zdobyte punkty

R1JtACwZFnfSH1
wymowa w języku angielskim: scored points
lower bound1
lower bound

dolna granica

R1N5cZYsy2qwV1
wymowa w języku angielskim: lower bound
variable1
variable

zmienna 

RCBeE3UIqQDMk1
wymowa w języku angielskim: variable