Acquaintance with the program Kumir mastering the basics of programming.

In it, students can gain practical skills in creating and debugging an algorithm, working with performers such as Robot, Draftsman, Aquarius, Grasshopper, Turtle.

When studying one of the most difficult sections of computer science "algorithmization and programming".

Purpose of development :

Download:


Preview:

Methodical development in informatics.

Topic: "Robot performer in the KuMir program at informatics lessons"

technology teacher "Informatics and ICT"

Explanatory note

Development goal: to study the possibilities of programming on the example of a specific executor Robot using the KUMIR environment; give practical skills to work with the performer.

Methodical developmentcompiled for informatics lessonsPractice on the computer: work with the educational executor of algorithms; drawing up linear, branching and cyclic algorithms for managing an executor; drawing up algorithms with a complex structure; use of auxiliary algorithms (procedures, subroutines).

Students should know:

  • what is a performer; SKI Robot, Wednesday performer Robot;
  • what is an algorithm;what are the main properties of the algorithm;
  • ways of writing algorithms: flowcharts, educational algorithmic language;basic algorithmic constructions: following, branching, loop; structures
  • algorithms; ⇒ assignment of auxiliary algorithms; technologies for building complex algorithms:

Students should be able to:

  • understand descriptions of algorithms in the curriculum algorithmic language;
  • perform an algorithm trace for a known performer;
  • compose linear, branching and cyclic control algorithms for the Robot executor; allocate subtasks; define and use auxiliary algorithms.

Session 1 (2 hours) Lesson 1.

Performer Robot.Executor command system.

Lesson plan.

  1. Description of the executor's UCS, the executor's environment.

2. Analysis of typical robot algorithms.

During the classes.

Consider the description of the performer.

Executor environment: Performer The robot is able to move through the labyrinth, drawn on a plane divided into cells.

SKI Robot : simple commands: up, down, left, right, fill.

Logic commands: (condition checks)

top free bottom free

left free right free.

Logical connectives: AND, NOT, OR:

Example: (Not left free) or (Not right free)

Branch command: cycle command:

If condition then nts while condition

series of commands series of commands

all kts

(In KIMs 2009 Robot commands different from those familiar to children, which led to confusion :)

Branch command: cycle command:

If condition then nts while condition do

series of commands series of commands

end end

General view of the Kumir program window. Graphical environment of the Robot:

in KIMs demo version 2010 command format changed to habitual

The order of creating the algorithm:

1.Teams Tools -Edit starting environmentdraw walls on the Robot field and set the Robot to its initial position.

2.Commands Robot - Change starting environmentsave the new environment.

3.Commands Paste- Use Robotspecify the artist.

4. In the document window, write the algorithm using the menu Insert.

5. Commands Execution - execute continuously (or step by step) run the algorithm.

6. Consider the result of the algorithm execution and, if necessary, debug it.

Lesson 1 (2 hours) Lesson 2.

Practical work "Compilation of linear algorithms.

Tasks: 1. Robot at an arbitrary point in the field. Color the cell above, below and to the right of the starting position.

  1. Robot at an arbitrary point in the field. Move the Robot 4 spaces to the right, painting over them.
  2. Create a new starting environment by drawing a 4-cell square on the board. Save the environment as a start.
  3. Create a new starting environment by drawing a corridor with passages in the walls on the field. Save the environment as obst2.fil. Change the starting environment to the newly created one.

Session 2 (2 hours) Lesson 1.

Topic : Branching and sequential refinement of the algorithm.

Analysis of CIM tasks using the Robot executor.

use robot

alg kim 2009

early

if not bottom loose

then to the right

all

if not bottom loose

then to the right

all

if not bottom loose

then to the right

all

con

use robot

alg kim 2010

early

if not bottom loose

then to the right

all

if not bottom loose

then to the right

all

if not bottom loose

then to the right

all

con

Etc. slave. No. 14. Compilation and debugging of branching algorithms

Tasks. See Attachment.

Lesson 3. Cyclic algorithms. Lesson 1-2

Target: reveal the essence of the concept of a cycle in algorithms, show the forms of writing cycles in algorithms, give skills in creating and writing cyclic algorithms.

Etc. slave. No. 15. Compilation and debugging of cyclic algorithms

1. Make an algorithm that paints all the inner cells adjacent to the wall.

use robot

alg

early

nc while right free

paint over; right

kts

nc while the bottom is free

paint over; way down

kts

nc until the bottom loose

paint over; to the left

kts

con

2. Create an algorithm that fills all the cells between the Robot and the wall. The distance to the wall is unknown.

use robot

alg

early

nc while right free

right; paint over

kts

con

3. Create an algorithm that paints over all the cells between two walls.

use robot

alg uch3

early

nc yet (not top loose) or (not bottom loose)

right

if (not top free) and (not bottom free)

then

paint over

all

kts

con

4. Create an algorithm that fills all the cells around a rectangular wall.

alg uch4

early

paint;up

nc until right loose

paint;up;

kts

paint;right

nc until the bottom loose

paint;right;

kts

paint over;down

nc until left loose

paint;down;

kts

paint;left

nc until top loose

paint over; left;

kts

con

use robot

alg uch5

early

right

nc until the bottom loose

paint over; right

kts

paint over; way down

nc while left free

paint over; to the left

kts

nc until left loose

paint over; way down

kts

paint;left;paint; up;

nc while top free

paint over; up

kts

nc until top loose

paint over; to the left

kts

con

Activity 4 Lesson 1

Helper Algorithms.

Target: introduce the concept of the main and auxiliary algorithm; explain the rules for using the auxiliary algorithm; parse examples of algorithms using an auxiliary.

Lesson Plan

1.Introduction of new terms (main and auxiliary algorithm, call) and explanation of new concepts.

2. Analysis of examples of solving problems using an auxiliary algorithm.

When solving some problems, it is convenient to break them into smaller subtasks, each of which can be designed as an independent algorithm. In this case, the so-called main algorithm is first compiled, in which calls to auxiliary algorithms are used to solve subtasks, which are added later. This kind of solution is calledsequential refinement method.It allows a group of programmers to work on a project, while each one solves his own subtask.

In the process of solving the problem, each auxiliary algorithm can, if necessary, be divided into smaller auxiliary algorithms.

The command to execute the auxiliary algorithm is called challenge and is written in the body of the main algorithm.

One and the same algorithm can be considered as the main and auxiliary in relation to other algorithms. In an algorithmic language, the main algorithm is written first, and auxiliary ones are written in a row below.

Task 1:

The robot is in the upper left corner of the field. There are no walls or shaded cells. Compose an algorithm, using an auxiliary one, drawing four crosses on one horizontal line. The final position of the Robot can be arbitrary.

Solution

Analysis on the board:

Task2. The robot is in the upper left corner of the field. There are no walls or shaded cells. Write an algorithm that paints an 8 x 8 square in a checkerboard pattern. The final position of the Robot can be arbitrary.

Activity 4 Lesson 2

Practical work on a PC "Problem solving using auxiliary algorithms".

Target : to instill practical skills in constructing algorithms by the method of sequential refinement.

Lesson Plan

1. The task is completely completed by the PC. Students receive tasks and complete them in the Kumir software environment. The results of the Work are saved as files for later verification.

Task1 . The robot is in the lower left corner of the field. There are no walls or shaded cells. Write an algorithm that paints 6 vertical stripes of the same length in 6 cells. The final position of the Robot can be arbitrary.

Task2 .Using auxiliary, make an algorithm for painting over the cells that form the number 1212.

Homework: Come up with an algorithm that draws the following image: Apply two auxiliary algorithms to solve the problem.

Activity 5 Lesson 1-2

Test

"Compilation of the algorithm in the environment of the executor Robot".

Target: to test the acquired knowledge on the creation and ability to analyze algorithms in the Kumir software environment.

Tasks for control work are divided by difficulty levels and includes 3 tasks with the executor Robot (tasks 1 and 2 - for branching and loops, task 3 - for using an auxiliary algorithm.) The texts of the tasks are given in the appendix.

The initial and final conditions and the created algorithms are recorded as a file.

The grade is set according to the level of difficulty of the task. The student has the right to choose the type of task.




Performer Robot Command system for the performer Robot Movement commands: up, down, left, right The robot moves one cell up, down, left, right. The command to paint over - paints over the cell in which the Robot is standing. Checking the validity of the condition: free from above, free from below, free from the left, free from the right The Robot checks the truth of the condition of the absence of a wall in the cell where the Robot is located. You can use the record of compound conditions formed logical operations AND, OR, NOT.




Performer Robot Direct environment editing All environment editing commands are performed using the mouse: put/remove a wall - click on the border between cells, paint/clear the cell - click on the cell, move the Robot - drag the mouse to the desired cell.


Executor Robot Robot menu commands Show Robot field Makes the Robot monitoring window visible. Print environment Creates a file in PDF format, showing the current situation in color or black and white. Save environment to file Creates text file with a description of the situation in the internal *.fil format. This file can later be loaded as a start environment (Change start environment command) or when editing the start environment (Open start environment edit windows command). Change as start environment Sets a new start environment file name (using the standard dialog) and loads a new start environment. Return to starting environment Makes the starting environment current.


Performer Robot Image of the current situation in the observation window The image of the current situation is always completely placed in the working field of the observation window for the Robot. The background of the working field is green. The shaded cells are grey. There are thin black lines between the cells. Walls Shown as thick yellow lines. In the cell of the working field of the observation window, the Robot is depicted as a rhombus.


Performer Robot Example 1. Let's create an algorithm called "Knight's Move" to get the Robot from point A to point B (Fig. 3). The algorithm has the form (Fig. 4.). After its execution, the Robot will move to the desired point (Fig. 5). An algorithm written in the language of the performer is called a program. Fig.3Fig.4 Fig.5











The Robot performer has a command system. Consider simple robot commands. There are 5 in total:

    up- move the Robot one cell up

    way down- move the Robot one cell down

    to the left- move the Robot one cell to the left

    right- move the Robot one cell to the right

    paint over

Exercise 1. Draw a square with a side of 3 cells.

Launching Kumir

Delete the symbol "|" and call our algorithm "Square" (next to official word alg write Square)

paint over

paint over

paint over

Run the program and see what happens. Press to launch F9 or the button on the toolbar Run program

If you do not have such a Robot window, then on the toolbar click " Show Robot window” or in the Robot menu, select the item “ Show Robot window". We continue further:

way down

paint over

way down

paint over

Then let's go to the left, painting the bottom border of the square

to the left

paint over

to the left

paint over

We have one unpainted cell left. Let's paint over it

up

paint over

All is ready! As a result, our program looks like this:

use robot

alg Square

paint over

paint over

paint over

paint over

paint over

paint over

paint over

paint over

Task 2.Using simple robot commands, write a program that draws a letter P, R, W, W, T, N.

Conditional loop.

The Robot performer has several conditions: top free bottom free left free right free top wall bottom wall

left wall right wall

Task 3 .

draw vertical line from the left to the right border of the field I use a loop with a condition. Initially, the Robot is in the upper left corner.

Source our Robot program will be something like this:

use robot

alg

early

paint over

nc while right free

right

paint over

kts

con

As a result of the execution of this program, we will see the following picture:

Task 4.Write a program that will make a frame around the working field of the Robot, regardless of its size. Of course, using conditional loops. As a result, it should turn out like this:


The whole process consists of two stages: assembly and programming. To collect good robot knowledge of mechanics is required. To program a robot for certain actions, you need to know a language that will understand motherboard or program block. School knowledge in computer science is not enough here.

Where to get material?

First you need to decide how you want to assemble the robot: from ready-made kits or select materials yourself. The advantage of the kit is that you don't have to look for the parts individually. Most often, several devices can be assembled from one set.

A structure that is not assembled from a ready-made set is called open system. It also has its advantages: your robot will be an individual, and you yourself will be able to improve the design. But you will definitely spend more time and effort.

What is the robot made of?

Housing - metal or plastic "body", to which the rest of the parts are attached. Each robot has a source of energy - batteries or an accumulator. Depending on what task the robot will perform, sensors are chosen: they can detect color and light, and respond to touch.

To make the robot move, you need motors. "Head" of the whole mechanism - the motherboard or the program block. With their help, the robot connects to the computer and receives a set of tasks.

How to make him do something?

In order for the robot to perform some action, you need to create computer program. The complexity of this step depends on the assembly. If the robot is assembled from a set Lego Mindstorms or mBot, even children can handle their software.

If you are building a robot yourself, you need to learn the basics of programming and the language in which you are going to write the program, such as C ++.

Why can't the robot execute the program?

Getting to a new place, he can go astray and execute the program incorrectly. In order for the robot to do everything correctly, it is necessary to adjust the sensors. For example, lighting that is too bright can interfere with adequate color recognition. Depending on the surface on which the robot moves, the power of the motors is adjusted.

Can I learn how to assemble and program at school?

Despite the fact that robotics is not included in the school curriculum, teachers in physics and computer science can teach a child to assemble and program. In Belgorod, some schools have circles where they make robots.

“After lessons with physics and computer science teachers, we learn to program. We already know how to work in LegoMindstorms and Robolab ( software for robots - approx. ed.). We also sometimes learn how to make 3D drawings of parts,” said students of the Belgorod Engineering Youth Boarding Lyceum and participants of RoboFest-2018 Anton Pershin and Dmitry Chernov.

Where, besides school, can one become a roboticist?

The engineering school of BelSU has a class where they teach how to assemble and program robots. In 2017, Quantorium opened in Belgorod, where schoolchildren are taught robotics from the age of nine.

To become a real roboticist, you can enter the Faculty of Robotics. There are no such people in Belgorod yet, but in BSTU im. Shukhov has a department of technical cybernetics. Her students win prizes at all-Russian competitions in robotics.

Can you learn on your own?

Yes. There are many resources on the Internet where you can learn what to build and how to program a robot.

Will the robot be useful?

It can be adapted for everyday tasks and made an assistant in the house. There are many examples on the Internet of how home inventors create robots for baking pancakes or cleaning an apartment.

How to confirm your success in creating robots?

Take part in competitions such as RoboFest. There are different nominations depending on age and direction. Basically, each type of robot has a track on which it performs tasks: capture a cube or draw a line. There are also static systems in which judges evaluate the presentation of the project and the operation of the mechanisms.

As a rule, participants come to competitions with assembled by robots and in preparation, they spend time only on calibrating sensors and adjusting the program.

The editors are grateful for the help in creating the material of the participants of RoboFest-2018 Dmitry Agafonov, Dmitry Chernov, Anton Pershin and Danila Migrina.

Natalia Malyihina