Computer science in the first school. Practical work in computer science

Introduction to the Idol program and mastering the basics of programming.

In it, students can gain practical skills in creating and debugging an algorithm, working with such performers 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:

Methodological development in computer science.

Topic: “Robot performer in the KuMir program in computer science lessons”

technology teacher "Informatics and ICT"

Explanatory note

Development goal: study programming possibilities using the example of a specific Robot performer using the KUMIR environment; provide practical skills in working with a performer.

Methodological developmentcompiled for computer science lessonsPractice on the computer: work with educational algorithm executor; drawing up linear, branching and cyclic algorithms for executor control; drawing up algorithms with a complex structure; use of auxiliary algorithms (procedures, subroutines).

Students should know:

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

Students should be able to:

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

Lesson 1 (2 hours) Lesson 1.

Performer Robot.Executor command system.

Lesson plan.

  1. Description of the performer's SKI, the performer's environment.

2. Analysis of typical Robot algorithms.

Progress of the lesson.

Let's look at the artist's description.

Artist Environment: Performer The robot can navigate through a labyrinth drawn on a plane divided into cells.

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

Logical 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: loop command:

If the condition then no condition yet

A series of commands a series of commands

that's all kts

(In the 2009 CMMs, the Robot’s commands were different from those familiar to children, which led to confusion :)

Branch command: loop command:

If the condition then nts for now the condition to do

A series of commands a series of commands

end end

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

In KIMs demo version 2010 team format changed to habitual

The procedure for creating an algorithm:

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

2.Teams Robot - Change starting environmentmaintain the new environment.

3.Teams Insert - Use Robotindicate the artist.

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

5. Using Execution commands – run the algorithm continuously (or step by step).

6. Consider the result of executing the algorithm 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. Paint the cell above, below and to the right of the original position.

  1. Robot at an arbitrary point in the field. Move the Robot 4 squares to the right, coloring them.
  2. Create a new starting environment by drawing a square with a side of 4 squares on the field. Save the setting as the starting one.
  3. Create a new starting environment by drawing a corridor on the field with passages in the walls. Save the environment as obst2.fil. Change the starting environment to the newly created one.

Lesson 2 (2 hours) Lesson 1.

Subject : Branching and sequential refinement of the algorithm.

Analysis of CMM tasks using the Robot performer.

use Robot

alg kim 2009

beginning

if not free from below

then to the right

All

if not free from below

then to the right

All

if not free from below

then to the right

All

con

use Robot

alg kim 2010

beginning

if not free from below

then to the right

All

if not free from below

then to the right

All

if not free from below

then to the right

All

con

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

Assignments. See Appendix.

Lesson 3. Cyclic algorithms. Lesson 1-2

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

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

1.Create an algorithm that paints all internal cells adjacent to the wall.

use Robot

alg

beginning

nts the right is free for now

paint over; right

kts

nts the bottom is free for now

paint over; down

kts

nts not free from below yet

paint over; left

kts

con

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

use Robot

alg

beginning

nts the right is free for now

right; paint over

kts

con

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

use Robot

alg uch3

beginning

nts yet (not free from above) or (not free from below)

right

if (not free from above) and (not free from below)

That

paint over

All

kts

con

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

alg uch4

beginning

paint over;up

nts not free on the right yet

paint over;up;

kts

paint over; right

nts not free from below yet

paint over;right;

kts

paint over;down

nts not free on the left yet

paint over;down;

kts

paint over; left

nts not on top yet free

paint over; left;

kts

con

use Robot

alg uch5

beginning

right

nts not free from below yet

paint over; right

kts

paint over; down

nts the left is free for now

paint over; left

kts

nts not free on the left yet

paint over; down

kts

paint over;left;paint over; up;

nts free on top for now

paint over; up

kts

nts not on top yet free

paint over; left

kts

con

Lesson 4 Lesson 1

Auxiliary algorithms.

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

Lesson Plan

1.Introduction of new terms (main and auxiliary algorithms, calls) 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 down into smaller subtasks, each of which can be formulated 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 solution is calledmethod of sequential refinement.It allows a group of programmers to work on a project, each solving their own subtask.

In the process of solving a 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.

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, followed by auxiliary ones.

Task 1:

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

Solution

Analysis on the board:

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

Lesson 4 Lesson 2

Practical work on a PC “Solving a problem using auxiliary algorithms”.

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

Lesson Plan

1.The task takes place entirely on a PC. Students receive assignments and complete them in software environment Idol. The results of the work are saved as files for later verification.

Problem 1 . The robot is in the lower left corner of the field. There are no walls or painted cells. Create an algorithm that paints 6 vertical stripes of equal length into 6 cells. The final position of the Robot can be arbitrary.

Problem 2 .Using auxiliary ones, create an algorithm for painting the cells that form the number 1212.

Homework: Come up with an algorithm that draws the following image: To solve the problem, use two auxiliary algorithms.

Lesson 5 Lesson 1-2

Test

“Drawing up an algorithm in the Robot executor environment.”

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

The tasks for the test are divided by difficulty level and include 3 tasks with the executor Robot (tasks 1 and 2 - on branching and loops, task 3 - on the use of an auxiliary algorithm.) The texts of the tasks are given in the appendix.

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

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

| Lesson planning and lesson materials | 7th grade | Planning lessons for the school year | Performer Robot

Lesson 30
Performer Robot
Robot Control
Working in the Algorithmics environment





Meet the Robot

Performer Robot acts on a rectangular checkered field. Walls may be located between some cells of the field. Some cells may be painted over (Fig. 3.11).

The robot occupies exactly one cell of the field. By commands up, down, left and right, the Robot moves to the adjacent cell in the indicated direction. If there is a wall in the way, a failure occurs - a message is displayed stating that it is impossible to execute the next command.

At the command to paint, the Robot paints the cell in which it stands. If the cell has already been painted over, it will be painted over again, although no visible changes will occur.

It is important to remember that the Robot can only execute correctly written commands. For example, if you write down instead of the command down, the Robot will not understand this entry and will immediately report an error.

♦ Remember what errors in command recording are called. What other mistakes should be avoided when developing algorithms?

Example of a Robot control algorithm

Let's write a program, executing which the Robot will draw a meander of five turns on a checkered field (Fig. 3.12).

The program might look like:

REPEAT 5 TIMES paint to the right; paint to the left; paint to the left; paint up; paint up; right; shade to the right; right; down right; down END

Here we used the repetition construction, since exactly identical fragments are repeated 5 times in the figure. When writing the body of the loop, we wrote several commands in one line separated by semicolons.

If you formalize the procedure as a loop, then the main program will turn out to be very short.

♦ Suggest your version of a program for drawing a meander.

Performer ROBOT is the “oldest” performer, the algorithm for which graduates are asked to perform in task No. 14 of the examination paper in computer science and ICT.

Let's consider individual elements of the task content necessary to understand the operation of the algorithm.

The ROBOT performer moves through a rectangular labyrinth drawn on a plane divided into cells. The ROBOT executor's command system contains eight commands:

  • commands-orders: up, down, left, right. When executing any of these commands, the ROBOT moves one square depending on the command.
  • four teams check the truth of the condition of the absence of a wall on each side of the cell where the ROBOT is located: Top free, bottom free, left free, right free.

Task No. 14. How many cells of the labyrinth (see Fig. 1) meet the requirement that, having started moving in this cell and executing the proposed program, the ROBOT will survive and stop in the same cell from which it started moving?

  • START
  •   BYE up
  •   BYE left
  •   BYE down
  •   BYE to the right
  • END

Solution.

To return the robot to its original cell, its trajectory must be a rectangle or a segment - horizontal or vertical. Let's look at possible cases and find out necessary conditions to return the robot to its original cell.

First case. Rectangular path:

  • Obviously, the four walls should restrict the robot's movement in the following order: first on the right, then on the top, then on the left and finally on the bottom (see Fig. 2)

Second case. Linear trajectory:

  • (a) horizontal line: the robot must move first to the left and then to the right. Analysis of the program shows that in this case two instructions should not be executed - “BYE<справа свободно>up" and "BYE<слева свободно>down". This means that the checkered plane must contain corresponding restrictions on the right and left (see Fig. 3)
  • (b) vertical line: the robot must move first down, then up. Similar to the previous reasoning, we have: two instructions should not be executed - “BYE<сверху свободно>left" and "BYE<снизу свободно>to the right. Therefore, the checkered plane must have corresponding restrictions above and below (see Fig. 4)

It is easy to see that in all the listed cases the desired cell has a lower bound. Let us note such candidate cells (see Fig. 5).

Further analysis of the maze in which the robot moves shows that the first case is satisfied by cell C4, the second case (a) is satisfied by cells E2, B2, and, finally, the second case (b) is satisfied by cell D5 (see Fig. 6).

The system can be used to solve problems on the topics “Executor and his commands”, “Procedures”, “Functions”, “Cycles”, “ Conditional statements", "Variables", "Arithmetic Expressions", " Logical operations and logical variables”, “Global variables”, “Input and output operators”, “Character strings”, “Arrays”, “Matrixes”, etc.

Programming language in the environment Performers fully Russified, programs are typed and edited using a built-in editor with syntax highlighting.

Basic designs supported C language.

Error messages when broadcast and executed, they are displayed in Russian.

There is a built-in debugger with the ability to execute programs in a step-by-step mode with tracing of procedures and functions. The values ​​of variables can be controlled during program execution in step-by-step mode.

The actions of the performers are displayed on the screen, used animation.

A check is performed for the Robot performer correctness of the decision tasks after the program ends.

System Requirements

The program runs on 32-bit operating systems of the line Windows: Windows 95, Windows 98,Windows NT, Windows 2000, Windows XP and compatible with them. Works for everyone modern computers, takes about 1 MB on your hard drive.

IN operating system Linux you can run the program in the environment Wine. Additionally, you need to copy the font files from the Windows\Fonts folder (from the computer on which you installed Windows) to the /home/user/.wine/drive_c/windows/Fonts/ folder on the computer with Linux.

After unpacking the archive, the program is immediately in working order and does not require any additional settings.

For English language, which ensures the replacement of all keywords language, interface elements and system messages into English. Please note that when updating the program version, you must also update and a localization file.

News now also in the Telegram channel

March 15, 2019
Training program posted PasLaz V.A. Pasevich Lazarus environment.

December 23, 2018
Developments posted V.A. Pasevich(Robot, Turtle).

September 11, 2018
Now you can copy the contents of the console window to the clipboard.

November 20, 2016
New version: It is now possible to call the main program recursively.

License

Learning environment Performers and methodological developments are distributed according to the principle “As is” - “As Is”. This means that you use them at your own risk and the author does not bear any responsibility for damage caused to you personally and to your computer as a result of using the programs and techniques obtained on this site.

  1. 1) publication of materials in any form, including posting of materials on other Web sites;
  2. 2) distribution of incomplete or altered materials;
  3. 3) inclusion of materials in collections on any media;
  4. 4) obtaining commercial benefits from the sale or other use of materials.

Downloading materials means you accept the terms of this license agreement.

Download materials from other authors

All materials are posted in the public domain with the consent of the authors.

Training program PasLaz V.A. Pasevich, designed to transition from executor programming to programming in the Lazarus environment. 15.03.2019
Tasks for performers Robot and Turtle. Author - V.A. Pasevich, Honored Teacher of the Russian Federation. (2,784 KB)
Algorithmics course (7th grade): performers Robot, Draftsman and Turtle. Author - L.A. Kayushkina, MBOU Secondary School No. 11, Ishimbaya, Republic of Bashkortostan (472 Kb)
Work program “Algorithmics” (5th grade, Federal State Educational Standard): performers Robot, Draftsman and Turtle. Author - N.E. Leko, secondary school No. 9, Tikhvin (220 Kb)
Development of lessons for the performer Robot. Author - S.V. Chaichenkov, MBOU Grushevskaya secondary school, Aksai district, Rostov region. (2 454 Kb)
Curriculum: performers Robot, Draftsman and Turtle. Author - N.E. Leko, secondary school No. 9, Tikhvin (200 Kb)
Author - G.A. Gavryukova, Municipal Educational Institution Secondary School No. 68, Ryazan (ZIP archive, 3,380 Kb)Robot
PROGRAM/DRAWER Draftsman
PROGRAM/TURTLE subdirectory with example programs for the performer Turtle
PROGRAM/KURS subdirectory with example programs for an artist-independent programming course
PROGRAM/FRACTALS subdirectory with examples of programs for constructing fractals
PROGRAM/PASEVICH subdirectory with developments by V.A. Pasevich (Robot, Turtle)

After unpacking the archive, the program is in working condition and does not require any additional installations.

Share