Idol program

Artist Robot


Who is Performer Robot?

  • Imagine a checkered field (like a sheet of a checkered notebook) on which there is an object, which we will call a Robot. Using special commands, we can control this Robot - move it around the cells, paint over the cells. And in most cases, our task will be to write such a program for the Robot, by executing which it will paint over certain cells.

Setting up the idol environment for the Robot performer

  • The running program Idol looks like this.

Starting environment of the Robot

  • Before starting the execution of the program, it is necessary to set the starting situation for the Robot performer. This means placing the Robot in the desired position, arranging the walls, painting the required cells, etc. This step is very important. If you ignore it, then the program may not work correctly or even crash altogether.

Press Edit furnishings



Artist Robot. Simple commands.

  • up
  • down
  • to the left
  • to the right
  • paint over

The result of executing these commands is clear from their name:

  • up - move the Robot one square up
  • down - move the Robot one square down
  • left - move the Robot one square to the left
  • right - move the Robot one square to the right
  • paint over - paint over the current cell (the cell in which the Robot is located).

Algorithm example

  • First you need to write the phrase:
  • use Robot

If you know how many cells you need to paint over, then the solution algorithm will be as follows!


Task number 1

  • Write a program to solve the following problem, if you know how many cells you need to paint

Cycles

  • 1. Cycle with counter it is used when it is known in advance how many repetitions must be done.

nts times

kts

Here we must indicate the number of repetitions (number) and the commands that will be repeated. The commands that are repeated in the loop are called the body of the cycle.



Task number 2

  • Write a program to solve the following problem using a counter loop

  • 2. Loop with condition while the condition is true - the loop is executed, if false is not true
  • The executor Robot has several conditions

free from above

from below freely

left freely

right freely

top wall

bottom wall

left wall

right wall

  • Particles can be used: NOT, AND, OR

Conditional loop structure

nc bye right freely

to the right

paint over

kts



Task number 3

  • Write a program to solve the following problem using a conditional loop:

Task number 4

  • Write a program to solve the following problem using conditional loops:



Solving problems:

  • 2. The robot must be transferred from the start position to the end position by painting over the walls


Task number 5

  • There is a horizontal wall on the endless field. The length of the wall is unknown. The robot is on top of the wall at its left end. The figure shows the location of the robot relative to the wall (the robot is marked with the letter "P"):

Answer to task number 5

  • nts until (bottom free)

paint over

The beginning of the cycle (nts) and the condition (not yet (free from below)) are written on one line.



Design if a

  • top free bottom free left free right free
  • These commands can be used in conjunction with the condition "if a" that looks like this:
  • if a condition then
  • sequence of commands
  • For example, to move one cell to the right, if there is no wall on the right, and painting the cell, you can use the following algorithm:
  • if the right is free then
  • to the right
  • paint over

Task number 7

The lengths of the walls are unknown.


Answer to task number 7

until the top is free

paint over

to the right

while the top is free

to the right

while on the right is free

paint over

to the right

until the right is free

paint over

down

while on the right is free

down

until the right is free

paint over

down


Task number 8

The lengths of the walls are unknown.

Each wall has exactly one passage, the exact location of the passage and its width are unknown.


Answer to task number 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


Task number 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.


Answer to task number 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


Task number 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.


Answer to task number 10

while the left is free

until left free

paint over

while the left is free

until left free

paint over

until the right is free

paint over

while on the right is free

until the right is free

paint over


Task number 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.


Answer to task number 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


Task number 12

There is a staircase on the endless field. First, the stairs go down from right to left, then go down from left to right. The height of each step is one cell, the width is two cells. The robot is to the right of the top rung of the ladder. The number of steps leading to the left and the number of steps leading to the right is unknown. The figure shows one of the possible ways of placing the ladder and the Robot (the Robot is marked with the letter "P").


Answer to task number 12

We move down under the stairs from right to left until we reach the junction of the stairs:

nts until the bottom is free

down

to the left

to the left

We move down to the end of the descending staircase, painting over the necessary cells on the way:

nts not yet left free

paint over

to the right

paint over

to the right

down



Answer to task number 13

nts so far left free

paint over

to the left

up

nts not yet left free

paint over

up


Task number 14

The infinite field has 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 of positioning the walls and the Robot (the Robot is marked with the letter "P").


Answer to task number 14

while on the right is free

to the right

while the top is free

up

paint over

nts so far left free

to the left

paint over



Answer to task number 15

while on the right is free

paint over

to the right

while the bottom is free

paint over

down

paint over

until (bottom free)

to the left

down

until (right is free)

paint over

down

paint over

to the right

until (top free)

paint over

to the right



Answer to task number 16

until the right is free

paint over

down

paint over

to the right

until the top is free

paint over

to the right

while the top is free

up

while on the right is free

paint over

to the right

until the right is free

paint over

down



Artist ROBOT is the "oldest" performer, the algorithm for which is proposed to be performed by graduates in task No. 14 of the examination work in computer science and ICT.

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

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

  • command commands: up, down, left, right... When any of these commands are executed, the ROBOT moves one cell depending on the command.
  • four commands check the truth of the condition that there is no wall on each side of the cell where the ROBOT is located: top free, bottom free, left free, right free.

Problem number 14. How many cells of the labyrinth (see Fig. 1) meet the requirement that, having started movement in this cell and fulfilling the proposed program, the ROBOT will survive and stop in the same cell with which it started movement?

  • START
  • WHILE up
  • WHILE left
  • WHILE down
  • WHILE right
  • END

Decision.

To return the robot to its original cell, it is necessary that its trajectory is a rectangle, or a segment - horizontal or vertical. Let's consider the possible cases and find out the necessary conditions for the robot to return to its original cell.

First case. Rectangular path:

  • Obviously, the four walls should restrict the movement of the robot in the following order: first from the right, then from above, then from the left and finally from below (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 the corresponding restrictions on the right and left (see Fig. 3)
  • (b) vertical line: the robot must move first down, then up. Similarly to the previous reasoning, we have: two instructions should not be executed - "BYE<сверху свободно>left "and" BYE<снизу свободно>to the right. Therefore, on the checkered plane there must be appropriate restrictions above and below (see Fig. 4)

It is easy to see that in all the cases listed above, the required cell has a lower bound. Let's mark such candidate cells (see Fig. 5).

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

For the ability to write programs for the performer Robot is very important. These tasks are related to tasks with a high level of complexity and allow you to earn an additional 2 points (provided that the solution is correct). We will study the Robot.

A 9th grade graduate must have an idea of ​​algorithms, be able to write. To write algorithms, you can use programming languages ​​or formal languages. Executor Robot can execute algorithms, while doing it very clearly. The robot is the so-called GRAPHIC TRAINING PERFORMER (GRIS) because the results of its work are presented in a graphical form.

Who is Performer Robot?

Imagine a checkered field (like a sheet of a checkered notebook) on which there is an object, which we will call a Robot. Using, we can control this Robot - move it around the cells, paint over the cells. And in most cases, our task will be to write such a program for the Robot, by executing which it will paint over certain cells.

Artist Robot is included in the Kumir package (Set of Educational WORLDS), which was developed by the Scientific Research Institute for System Research of the Russian Academy of Sciences (NIISI RAS) just for teaching programming at school. In addition to the Robot, there are other performers in the Kumir system, but we are not interested in them yet.

Download Artist Robot

So, first we need. Don't be confused by the fact that the name says 32-bit, the program works fine on 64-bit Windows too. If you are using Linux, then you can use the version for this OS.

Next, you need to install the downloaded program. Here, I hope, you will not have any difficulties, the process is standard and intuitive. If suddenly something does not work out - write in the comments, I will definitely help. The only thing is that I recommend that you abandon unnecessary items during installation (everything except Wednesday Idol)

After successful installation, a shortcut to launch the program will appear on your desktop

And after starting the program, we should see the program window

Executor Robot - program window

| Lesson planning and lesson materials | 7 classes | Planning lessons for the academic year | Artist Robot

Lesson 30
Artist Robot
Robot Control
Work in the "Algorithmic" environment





Meet the Robot

Artist The robot operates on a rectangular checkered field. Walls can be located between some cells of the field. Some cells can be painted over (Fig. 3.11).

The robot occupies exactly one square of the field. By commands up, down, left and right, the Robot moves to the adjacent cell in the specified direction. If there is a wall on the way, then a refusal occurs - a message is issued about the impossibility of executing the next command.

On the command to paint over, the Robot paints the cell in which it is standing. If the cell has already been painted over, then 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 instead of the command down, write down, then the Robot will not understand this entry and will immediately report an error.

♦ Remember the names of errors in command recording. What other mistakes should you avoid when designing algorithms?

An 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 may look like:

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

Here we used the construction of repetition, since absolutely 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 make a loop procedure, then the main program will be very short.

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

It is always difficult for beginners in the field of programming to leave their choice on one or another editorial complex, because a priori there are a great many of them. Well, in order not to go deep into the jungle of this fascinating and entertaining topic, within the framework of this article, I want to give a short and short excursion to the best software package, which opens up a whole set of opportunities for young people who want to become real programmers. Immediately, we note that by deciding to download the robot performer program, about which this conversation is being conducted, you are guaranteed to receive initial skills in programming and other editorial actions.

So, having chosen the solution to download the robot performer program with strict adherence to the recommendations given by me above, you get at your disposal a fully functioning complex of several programming tools, equated by specialists to professional software of this class. According to the true masters of the direction of active development and programming, the program in the form of a robot performer, voiced in the title above, after downloading and installing, opens up endless opportunities for beginners who want to comprehend all the basics of this unusually interesting industry.

Download the robot performer program for free and without registration

The standard installation file of the program called Robot Studio, the robot performer, as usual includes several developer tools that support many different tasks and do not require additional downloading of a third-party distribution kit. In other words, the advertised product seems to be an ideal solution for beginners and experienced professionals who have wished to return to the basics of programming in order to find answers to questions that remained unsettled in their youth, but suspended "in the air", let us say so.


A large number of user settings integrated into the application makes it very attractive and beneficial for the younger generation, who do not yet consider themselves too experienced. In their opinion, obtained in the course of several questionnaires, it became clear that there is simply no better application with this functionality and cannot be.


Make sure in all my non-verbal statements about the use of this convenient and multifunctional application for your own purposes and tasks, as a beginner programmer, you will be helped by the decision to download the distribution kit from our site using the links below, which provide, in addition to maximum speed, also the absence of advertising. You can also download other software from our website absolutely free of charge by going to the corresponding section of the catalog.