Download the robot turtle program for drawing. Key features and functions. Setting up the environment Idol for the performer Robot
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 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.
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 training executor algorithms; 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 of writing algorithms: flowcharts, educational algorithmic language;basic algorithmic structures: 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.
- Description of the performer's SKI, the performer's environment.
2. Analysis of typical Robot algorithms.
During the classes.
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. Graphics environment Robot:
In KIMs demo version 2010 team format changed to habitual
The procedure for creating an algorithm:
1.Teams Tools -Edit starting environment draw 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.
- Robot at an arbitrary point in the field. Move the Robot 4 squares to the right, coloring them.
- 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.
- 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
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 recording cycles in algorithms, give skills in creating and writing cyclic algorithms.
Etc. 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 basic and auxiliary algorithm; 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, and auxiliary algorithms are written down in a row.
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. Write an algorithm that paints 6 vertical stripes the same length of 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 next 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.
Tasks for test work are divided by difficulty level and includes 3 tasks with the performer Robot (task 1 and 2 - on branching and loops, task 3 - on using 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.
For in English, 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
A 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) publication of materials in any form, including posting of materials on other Web sites;
- 2) distribution of incomplete or altered materials;
- 3) inclusion of materials in collections on any media;
- 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 public access with the consent of the authors.
Tutorial 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 order and does not require any additional installations.
Idol program
Performer Robot
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img1.jpg)
Who is the Robot performer?
- Imagine a checkered field (like a sheet from a notebook with a checkered pattern) on which there is a certain object, which we will call a Robot. Using special teams, we can control this Robot - move it around the cells, paint over the cells. And in most cases, our task will be to write a program for the Robot, in which it will paint certain cells.
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img2.jpg)
Setting up the environment Idol for the performer Robot
- The launched Idol program looks like this.
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img3.jpg)
Robot starting environment
- Before starting the program execution, it is necessary to set the starting environment for the Robot executor. This means placing the Robot in the desired position, placing walls, painting the required cells, etc. This step is very important. If you ignore it, the program may not work correctly or even crash.
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img4.jpg)
Press Edit environment
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img5.jpg)
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img6.jpg)
Performer Robot. Simple commands.
- up
- down
- left
- right
- paint over
The result of executing these commands is clear from their names:
- up - move the Robot up one cell
- down - move the Robot one cell down
- left - move the Robot one cell to the left
- right - move the Robot one cell to the right
- paint over - paint over the current cell (the cell in which the Robot is located).
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img7.jpg)
Algorithm example
- First you need to write the phrase:
- use Robot
If you know how many cells need to be painted, then the solution algorithm will be as follows!
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img8.jpg)
Task No. 1
- Write a program to solve the following problem if you know how many cells need to be shaded
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img9.jpg)
Cycles
- 1. Loop with counter used when it is known in advance how many repetitions need to be done.
nc time
…
kts
Here we must specify the number of repetitions (number) and the commands that will be repeated. Commands that are repeated in a loop are called body of the cycle.
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img10.jpg)
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img11.jpg)
Task No. 2
- Write a program to solve the following problem using a loop with a counter
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img12.jpg)
- 2. Loop with condition - while the condition is true, the loop is satisfied, if false, it is not satisfied
- The Robot performer has several conditions
free on top
free from below
left free
free on the right
wall above
wall below
left wall
wall on the right
- Particles you can use: NOT, AND, OR
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img13.jpg)
Conditional loop structure
nts for now free on the right
right
paint over
kts
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img14.jpg)
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img15.jpg)
Task No. 3
- Write a program to solve the following problem using a conditional loop:
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img16.jpg)
Task No. 4
- Write a program to solve the following problem using conditional loops:
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img17.jpg)
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img18.jpg)
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img19.jpg)
Problem solving:
- 2. The robot must be moved from the starting position to the final position, painting the walls
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img20.jpg)
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img21.jpg)
Task No. 5
- There is a horizontal wall on an endless field. The length of the wall is unknown. The robot is located on top of the wall at its left end. The figure shows the location of the robot relative to the wall (the robot is designated by the letter “P”):
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img22.jpg)
Answer to task No. 5
- nc not yet (bottom free)
paint over
The beginning of the cycle (nc) and the condition (not yet (free from below)) are written on one line.
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img23.jpg)
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img24.jpg)
Design If
- top free bottom free left free right free
- These commands can be used in conjunction with a condition "If", having the following form:
- If condition That
- sequence of commands
- For example, to move one cell to the right, if there is no wall on the right, and paint the cell, you can use the following algorithm:
- if the right is free then
- right
- paint over
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img25.jpg)
Task No. 7
The lengths of the walls are unknown.
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img26.jpg)
Answer to task No. 7
until the top is free
paint over
right
while the top is free
right
while it's free on the right
paint over
right
not yet free on the right
paint over
down
while it's free on the right
down
not yet free on the right
paint over
down
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img27.jpg)
Task No. 8
The lengths of the walls are unknown.
Each wall has exactly one passage, exact location the passage and its width are unknown.
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img28.jpg)
Answer to task No. 8
while the top is free
until the top is free
paint over
while the top is free
until the top is free
paint over
until the bottom is free
paint over
while the bottom is free
until the bottom is free
paint over
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img29.jpg)
Task No. 9
The lengths of the walls are unknown.
Each wall has exactly one passage, the exact location of the passage and its width are unknown.
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img30.jpg)
Answer to task No. 9
while the bottom is free
until the bottom is free
paint over
while the bottom is free
until the bottom is free
paint over
until the top is free
paint over
while the top is free
until the top is free
paint over
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img31.jpg)
Task No. 10
The lengths of the walls are unknown.
Each wall has exactly one passage, the exact location of the passage and its width are unknown.
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img32.jpg)
Answer to task No. 10
while the left is free
while the left is free
paint over
while the left is free
until the left is free
paint over
not yet free on the right
paint over
while it's free on the right
not yet free on the right
paint over
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img33.jpg)
Task No. 11
The lengths of the walls are unknown.
Each wall has exactly one passage, the exact location of the passage and its width are unknown.
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img34.jpg)
Answer to task No. 11
until the top is free
until the top is free
paint over
while the bottom is free
until the top is free
paint over
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img35.jpg)
Task No. 12
There is a staircase on the endless field. The staircase first goes down from right to left, then down from left to right. The height of each step is one square, the width is two squares. The robot is to the right of the top step of the stairs. The number of steps leading to the left and the number of steps leading to the right are unknown. The figure shows one of the possible ways to position the ladder and the Robot (the Robot is designated by the letter “P”).
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img36.jpg)
Answer to task No. 12
We move down under the stairs from right to left until we reach the junction of the stairs:
nts the bottom is free for now
down
left
left
We move down to the end of the descending staircase, painting the necessary cells along the way:
nts not free on the left yet
paint over
right
paint over
right
down
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img37.jpg)
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img38.jpg)
Answer to task No. 13
nts the left is free for now
paint over
left
up
nts not free on the left yet
paint over
up
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img39.jpg)
Task No. 14
On an infinite field there is a rectangle bounded by walls. The lengths of the sides of the rectangle are unknown. The robot is inside a rectangle. The figure shows one of the possible ways to position the walls and the Robot (the Robot is designated by the letter “P”).
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img40.jpg)
Answer to task No. 14
while it's free on the right
right
while the top is free
up
paint over
nts the left is free for now
left
paint over
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img41.jpg)
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img42.jpg)
Answer to task No. 15
while it's free on the right
paint over
right
while the bottom is free
paint over
down
paint over
not yet (bottom free)
left
down
not yet (free on the right)
paint over
down
paint over
right
not yet (free on top)
paint over
right
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img43.jpg)
![](https://i1.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img44.jpg)
Answer to task No. 16
not yet free on the right
paint over
down
paint over
right
until the top is free
paint over
right
while the top is free
up
while it's free on the right
paint over
right
not yet free on the right
paint over
down
![](https://i2.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img45.jpg)
![](https://i0.wp.com/arhivurokov.ru/multiurok/html/2017/04/17/s_58f461a4f3fa2/img46.jpg)
Performer Robot
KuMir programming environment
Often in lessons and in task 20.1 the “Robot” performer is required to go down or up the stairs. You must understand that going up or down the stairs is carried out one cycle. As a rule, to check the performance of the algorithm, it is necessary to add steps on the ladder. The algorithm must be executed regardless of the number of stages, for example, both for two stages and for twenty.
TASK
In an infinite field, there is a horizontal wall that continues indefinitely to the left and ends with a staircase that goes down from left to right. The height of each step is two squares, the width is two squares. The robot is on a horizontal wall to go down the stairs. The figure shows one of the ways to position the ladder and the Robot (the Robot is indicated by the symbol ◊ ).
Write an algorithm for the Robot that paints all the cells located on the steps of the stairs. It is required to paint only the cells that satisfy this condition.
For example, for the above drawing, the Robot must color the cells:
The final location of the Robot can be arbitrary. The algorithm must solve the problem for an arbitrary field size and any number of steps. When executing the algorithm, the Robot should not be destroyed.
SOLUTION
We will solve this problem in the KuMir programming environment. Open the program and go to the Robot menu -> Edit environment
We are building a staircase. With the left mouse button we click on the walls of the cage. Move the diamond (robot) to the desired location by holding left button mice
Exit the editing mode of the Robot menu -> Edit environment. Next, write the command “use Robot” on the first line.
First, let's remember some commands for the Robot performer.
The assignment says that
The algorithm must solve the problem for an arbitrary field size and any number of steps
This means that the Robot must move using the While loop. We reason like this: there is a wall below the robot, which means it is not free from below. On the 4th line of the editor we write the command
nts is not free from below yet.
Inside the loop, you need to execute the commands sequentially:
To the right, down, paint to the right, to paint, to the left, to bottom, to paint, to the right, to paint
Fully ready-made program looks like that:
Use Robot alg start nc until the bottom is free right down paint right paint left down paint right paint kts end
To test the algorithm, let’s add a few more steps and check the result
![](https://i1.wp.com/amlesson.ru/wp-content/uploads/2018/10/ispolnitel-robot-itogovyy-rezultat.jpg)
So, the algorithm paints cells for any number of steps on the ladder.