The task of the teacher is to walk this path with the student, not insuring against failures, but preventing disappointment due to possible difficulties. It is very important to organize classes in such a way that children discover new things for themselves through meaningful activities.
How does a robot help learn computer science? I will only point out a few topics of informatics on which robotics is based.
Topic "Files and file system".
The student had at his disposal a LEGO®NXT microcomputer from the LEGO Mindstorms NXT Education educational set. Control it file system occurs with standard commands, but since the amount of memory is not large, control of the necessary and unnecessary must be constantly monitored. In order to voice the actions of the robot, display a picture, replenish the library of working programs, it is necessary to operate with the basic concepts of computer science: file, file type, file path, menu, folder.
Topic "Information processes", "Information coding".
The robotic kit is equipped with sensors that register sound, tactile and video information. After digitization, the information can be displayed on the display screen. A special function of the microcomputer makes it possible to experiment with sensors, motors, using ready-to-run programs. After conducting a series of experiments with sensors, an understanding arises: why an ultrasonic distance sensor is slower than an infrared light sensor, how sound is converted into a digital code, and so on. The study of information processes and the principles of information coding gives a deeper understanding of the essence of information technology.

Theme "Communication technologies".
LEGO®NXT Microcomputer Supports Technology wireless communication. Using the Bluetooth function, you can set wireless connection between the NXT microcomputer and other devices that have a Bluetooth device, such as other NXTs, with mobile phones or with computers. By setting bluetooth connection, perhaps: download programs from a computer remotely; send programs from other devices (not from a computer), including NXT; send programs to both individual NXTs and their groups. This technology makes it possible to control the robot using a mobile phone.

Topics “Algorithms. Executor of algorithms”, “Programming environment”.
For an initial introduction to the robot, you can directly program the NXT unit without accessing a computer. Directly on the display screen, according to a template of five commands, you can compose a simple program and loop it. However, one cannot do without knowledge of the basic algorithmic structures and development of the programming environment. It is the ability to program the robot that makes it a universal performer capable of solving a variety of tasks. You should start learning programming technology from visual programming environments, then moving on to more powerful and modern event-driven environments.
Thus, robotics requires basic knowledge of computer science, and the inexhaustible desire of the student to make his robot “the best” pushes him to master new knowledge.
Why can a robot be called an ideal learning tool? Because this tool makes it possible to create a learning environment that reclaims the natural aspirations of the child to play, create, communicate with peers. So, we can highlight the advantages of robotics as a means of education:
. The assimilation of knowledge occurs during the game.
. Robot construction offers creative freedom.
. The desire to improve their work is the majority of students.

As an example, I would like to give the model of the “Free Food Delivery Robot”, created by a 6th grade student as part of the “Programming by Robot” course in extracurricular activities. The robot is built from the LEGO MINDSTORMS NXT Education 9797 set using the standard Alfarex 1.0 model, and is completed with a color sensor to indicate the status of the robot and a treat tray.
The purpose of the work is to implement the human gait model as far as possible with the available resources. The movement of each leg is controlled by a motor and a mechanical assembly of gears and levers. One lever moves the leg up and down, the other moves it forward. In this case, the body deviates towards the supporting leg, due to which the robot maintains balance. This gait is called "shuffling"
A separate motor drives the distance sensor and the lever arms that hold the touch sensor and the color sensor. The tray for treats is fixed motionless.
The robot is programmed to perform the role of a peddler, for example, free treats, according to the following behavior algorithm. The robot accompanies its movement in a straight line with the phrase: “I am an Alpharex robot, I treat you for free!” A person wishing to make contact with the robot can stop it with a gesture. After stopping, the robot says the phrase: "Help yourself and press the button!". Taking a candy, a person as a token of gratitude must press the button once. Three seconds after stopping, the robot will continue its movement. When the treats are over (the robot is programmed for a specific amount of sweets on the tray), the robot will say goodbye, the red indicator will light up, the robot will stop.

The program for controlling the robot was written in the NXT Programming 2.0 environment.

Solution 20.1 OGE assignments 2017 in informatics from the demo. This is the task of the second part with a detailed answer, a high level of complexity. Estimated time to complete the task is 45 minutes. For this task, you can score a maximum of 2 points. The task is running on the computer.

Checked content elements:
- the ability to write a short algorithm in the environment of a formal performer.

Description of the content elements tested during the exam:
- algorithm,
properties of algorithms,
— ways of writing algorithms,
- block diagrams,
- Introduction to programming
- algorithmic structures,
booleans,
- operations,
- expressions,
- dividing the task into subtasks,
- auxiliary algorithm,
- processed objects (strings of characters, numbers, lists, trees).

20.1 task of the OGE 2017 in informatics

The Executor Robot is able to move through the labyrinth drawn on a plane divided into cells. Between adjacent (on the sides) cells there can be a wall through which the Robot cannot pass.
The Robot has nine commands. Four commands are commands-orders:
up
way down
to the left
right
When any of these commands is executed, the Robot moves one cell respectively: up , down ↓, left ←, right →. If the Robot receives a command to move through the wall, it will collapse.
The robot also has a team paint over, at which the cell in which the Robot is currently located is painted over.
Four more commands are commands for checking conditions. These commands check if the path is clear for the Robot in each of the four possible directions:
top loose
bottom loose
left free
right free
These commands can be used in conjunction with the " if", having the following form:
if condition then
command sequence
all
Here condition is one of the condition checking commands.
Command sequence is one or more of any command-orders.
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
all
In one condition, you can use several commands for checking conditions, using logical connectives and, or, not, for example:
if (right free) and (not bottom free) then
right
all
To repeat a sequence of commands, you can use the loop " bye", which looks like this:
nts bye condition
command sequence
kts
For example, to move to the right while possible, you can use the following algorithm:
nc while right free
right
kts

Complete the task.
The infinite field has horizontal and vertical walls. The left end of the horizontal wall is connected to the bottom end of the vertical wall. Wall lengths unknown. There is exactly one passage in the vertical wall, the exact location of the passage and its width are unknown. The robot is in a cage located directly above the horizontal wall at its right end.
The figure shows one of possible ways the location of the walls and the Robot (the Robot is indicated by the letter "P").

Write an algorithm for the Robot that paints all the cells immediately to the left and to the right of the vertical wall. The passage must remain unpainted. The robot must paint over only the cells that satisfy this condition. For example, for the above picture, the Robot must paint over the following cells (see picture).

When executing the algorithm, the Robot should not be destroyed, the execution of the algorithm should be completed. The final location of the Robot can be arbitrary.
The algorithm must solve the problem for any admissible wall arrangement and any location and size of the passage inside the wall.
The algorithm can be executed in the environment of a formal executor or written in a text editor.
Save the algorithm in a text file. The name of the file and the directory for saving you will be informed by the organizers of the exam.

Decision 20.1 of the task of the OGE 2017 in informatics

The performer's commands will be recorded bold font, and comments - in italics. The beginning of the comment will be denoted by the symbol "|" ( It is not necessary to write down comments during the execution of the work.).

|We move to the left until we reach a vertical wall.
nc while left free
to the left
kts

|We move up until we reach the passage in the wall, and paint over the cells.
nc until left loose
paint over
up
kts

|Move up to the end of the wall and paint over the cells.
nc until left loose
paint over
up
kts

|We go around the wall.
to the left
way down

|We move down until we reach the passage in the wall, and paint over the cells.
nc until right loose
paint over
way down
kts

|We move down to the end of the wall and paint over the cells.
nc until right loose
paint over
way down
kts

Other solutions are also possible.
It is allowed to use a different syntax for the instructions of the performer, more familiar to students.
It is allowed to have separate syntax errors that do not distort the intention of the author of the solution.

2 points for the task is given if
The algorithm works correctly for all valid input data.
1 point for the task is given if
For all valid inputs, the following is true:
1) the execution of the algorithm is completed, and the Robot does not crash;
2) no more than 10 extra cells are shaded;
3) no more than 10 cells from among those that should have been painted were left unpainted.
0 points for the task is given if
The task was completed incorrectly, i.e., the conditions that allow you to put 1 or 2 points are not met.

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

Executor Control Robot in the KUMIR system

The robot exists in a certain environment (rectangular checkered field). Walls can be located between some cells of the field. Some cells may be shaded (Fig. 3.11).

The robot occupies exactly one cell of the field.

On commands up, down, left and right, the Robot moves to the next cell in the specified direction. If there is a wall on the way, then a failure occurs - a message is displayed about the impossibility of executing the next command.

On command to paint over, the Robot paints over 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.

The robot can only execute correctly written commands. If you write down instead of the command down, then the Robot will not understand this entry and will immediately report an error.

O
errors: 1 syntactic; 2. logical

Scene descriptions are stored in text files special format (.fil format).

Current- the environment in which the Robot is in this moment(including information about the position of the Robot).

Home- the environment in which the Robot is forcibly placed at the beginning of the execution of the program using the Robot.

Operating procedure:


  1. Ask starting environment according to the task:
Menu Tools → Change the starting environment of the Robot (draw the environment according to the task condition, give a name, save in the Personal folder)

2. Specify the Contractor:

Insert Menu →Use Robot

3. Write an algorithm for solving the problem.

4. Run the algorithm (Menu Run → Run continuously / F9)

The system of commands of the executor Robot in the KUMIR system


Team

Action

up

The robot moves up 1 cell

way down

The robot moves down 1 cell

to the left

The robot moves 1 cell to the left

right

The robot moves 1 cell to the right

paint over

The robot paints the cell in which it is

right free

The robot checks the execution of the corresponding simple terms

left free



top loose



bottom loose



the cell is shaded



cage clean



Cyclic algorithms

Cycle organization of repeating actions until a certain condition is true .

Loop body - a set of repeatable actions.

Condition - boolean expression (simple or complex (compound))
Cycle types:

1.Loop "Repeat n times" 2. Loop "Bye"
nc n times nts bye
. . Loop body. . Loop body
kts kts

Example: nts bye right free


General view of the cycle "Repeat n times:

REPEAT n TIMES

THE END
kts

General view of the while loop:

WHILE TO DO

THE END
Compound conditions formed from one or more simple terms and service words AND, OR, NOT.


Compound Condition A and B(where A, B are simple conditions) is satisfied when each of the two simple conditions included in it is satisfied.

Let A - free on top AT - free on the right then the compound condition A and B- free on top AND free on the right.


Compound condition A OR B is satisfied when at least one of the two simple conditions included in it is satisfied: top free OR right free
Compound Condition NOT A- met when condition A is not met.

Example: Let A be a shaded cell (simple condition).

P Checking the compound condition NOT A:

a) A - done, NOT A (NOT shaded) - not done.

b) A - not done, NOT A (NOT shaded) - done.


Branch command

Branching - a form of organization of actions in which, depending on the fulfillment or non-fulfillment of a certain condition, either one or another sequence of actions is performed.

General view of the IF command:

IF THEN OTHERWISE

THE END

In the KUMIR language:

Full branching: Partial branching:
if then if then

otherwise

all all

Helper Algorithm- an algorithm that solves some subproblem of the main problem.

In the KUMIR system, auxiliary algorithms are written at the end of the main program (after official word con) are called for execution in the main program by name.

AT surveys and assignments

1. Give all the algorithms of the three commands that will move the Robot from its original position to cell B.

Is there an algorithm for this task, during which the Robot does:

a) two steps b) four steps; c) five steps; d) seven steps?


  1. Petya made an algorithm that transfers the Robot from cell A to cell B with some cells painted over. What should Kolya do with this algorithm in order to obtain an algorithm that takes the Robot from B to A and fills in the same cells?


7. Two are known auxiliary algorithms Robot

Draw what happens when the Robot performs the following basic algorithms:


a)

nc 5 times


pattern_1

right; right;


b)

nc 7 times


pattern_2

right; right


in)
right; right; right

up; up

right; right; right

way down; way down


G)
right; right
right; right

8. Create algorithms under which the Robot will paint over the specified cells:



9. It is known that somewhere to the right of the Robot there is a wall. Make up an algorithm, under the control of which the Robot will paint over a number of cells up to the wall and return to its original position.

10. It is known that somewhere to the right of the Robot there is a shaded cell.

FROM leave the algorithm, under the control of which the Robot will paint a number of cells up to the shaded cell and return to its original position.

11. It is known that the Robot is located near the left entrance to the horizontal corridor.

12. It is known that the Robot is somewhere in the horizontal corridor. None of the cells of the corridor is painted over.

Make up an algorithm, under the control of which the Robot will paint over all the cells of this corridor and return to its original position.


13. In a row of ten cells to the right of the Robot, some cells are shaded.

FROM leave the algorithm that paints the cells:

a) below each shaded cell;

b) above and below each shaded cell.


14. What can be said about the correctness of the following fragment of the algorithm?

nts bye the cell is shaded

IF right free THEN

right; paint over

to
c

15. Write a program with which the Robot can get to cell B in all three mazes.


16. Write a program, following which the Robot will be able to go along the corridor from the lower left corner of the field to the upper right. The corridor has a width of one cell and stretches in the direction from left-bottom-right-up. An example of a possible corridor is shown in the figure.

Z

adachi GIA


  1. Corridor1. The robot is somewhere in the vertical corridor. None of the cells of the corridor is painted over. Create an algorithm under which the Robot will paint over all the cells of this corridor and return to its original position.

  1. To
    Necessary

    Given
    corridor2. The robot is located in the upper cell of a narrow vertical corridor. The width of the corridor is one cell, the length of the corridor can be arbitrary.

A possible variant of the initial location of the Robot is shown in the figure (the Robot is indicated by the letter "P")

Write an algorithm for the Robot that fills all the cells inside the corridor and returns the Robot to its original position. For example, for the above picture, the Robot should paint over the following cells (see picture):


  1. There is a long horizontal wall on the endless field. The length of the wall is unknown. The robot is in one of the cages directly above the wall. The initial position of the Robot is also unknown. One of the possible positions:
H


Necessary

Given
Write an algorithm for the Robot that paints all the cells above and adjacent to the wall, regardless of the size of the wall and the initial position of the Robot. For example, for the given drawing, the Robot must paint over the following cells:

The final position of the Robot can be arbitrary. When executing the algorithm, the Robot should not be destroyed.



  1. There is a long vertical wall on the infinite field. The length of the wall is unknown. The robot is in one of the cages located directly to the right of the wall. The initial position of the robot is also unknown. One of the possible positions of the robot is shown in the figure (the robot is marked with the letter “P”): Write an algorithm for work that paints over all the cells adjacent to the wall: on the left, starting from the top unpainted and through one; on the right, starting from the bottom shaded and through one. The robot must paint over only the cells that meet this condition. For example, for the above figure, the robot must fill in the following cells (see figure): The final location of the robot can be arbitrary. The algorithm must solve the problem for an arbitrary wall size and any valid initial position of the robot. When executing the algorithm, the Robot should not collapse.


Write an algorithm for the Robot that paints all cells located to the left of the vertical wall and above the horizontal wall and adjacent to them. The robot must paint over only the cells that meet this condition. For example, for the above picture, the Robot must paint over the following cells (see picture).


H write an algorithm for the Robot that paints the cells adjacent to the wall, from above and below, starting from the left and through one. The robot must paint over only the cells that meet this condition. For example, for the given figure a) the Robot must paint over the following cells (see Fig. b).

The final position of the Robot can be arbitrary. The algorithm must solve the problem for an arbitrary wall size and any valid initial position of the Robot.



R

  1. There is a long vertical wall on the infinite field. The length of the wall is unknown. The robot is in one of the cages located directly to the left of the wall. The initial position of the robot is also unknown. One of the possible positions of the robot is shown in the figure (the robot is marked with the letter "P"):
Write for work an algorithm that paints over all the cells adjacent to the wall:

  • all on the left;

  • on the right, starting from the top unpainted and through one.
The robot must paint over only the cells that meet this condition.

B
1102_GIA2011

There are two horizontal walls on the infinite field. The length of the walls is unknown. The distance between the walls is unknown. The robot is located above the bottom wall in a cage located at its left edge. Write an algorithm for the Robot that paints all the cells located above the bottom wall and below the top wall and adjacent to them. The robot must paint over only the cells that meet this condition. For example, for the above drawing, the robot must fill in the following cells (see figure):

The final location of the robot can be arbitrary. The algorithm must solve the problem for an arbitrary field size and any admissible location of walls inside a rectangular field. When executing the algorithm, the Robot should not collapse.


AT
1103_GIA_2011


There is a horizontal wall on the infinite field. The length of the wall is unknown. From the right end of the wall, a vertical wall extends downward, also of unknown length. The robot is located above a horizontal wall in a cage located at its left edge. The figure shows one of the possible ways to arrange the walls and the Robot (the Robot is indicated by the letter "P").

Write an algorithm for the Robot that paints all the cells located above the horizontal wall and to the right of the vertical wall and adjacent to them. The robot must paint over only the cells that meet this condition. For example, for the above picture, the Robot must paint over the following cells (see picture).

Program Kumir

Artist Robot


Who is a robot performer?

  • Imagine a checkered field (like a sheet from a notebook in a box) 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, executing which it will paint over certain cells.

Setting up the Idol environment for the Robot performer

  • The launched Kumir program looks like this.

Starting environment of the Robot

  • Before starting the execution of the program, it is necessary to set the starting environment for the Robot executor. This means to install the Robot in desired position, arrange walls, paint over the desired cells, etc. This step is very important. If you ignore it, the program may not work correctly or even crash.

Press Edit environment



Performer Robot. Simple Commands.

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

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

  • up - move the Robot one cell up
  • 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).

Algorithm Example

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

If it is known how many cells need to be painted 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 to paint

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 cycle are called cycle body.



Task number 2

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

  • 2. Loop with condition- while the condition is true, the loop is true, if false, then it is not true
  • The robot performer has several conditions

top loose

bottom loose

left free

right free

top wall

bottom wall

left wall

right wall

  • You can use particles: NOT, AND, OR

Conditional Loop Structure

nts bye right free

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:



Problem solving:

  • 2. The robot must be transferred from the starting position to the final position, painting the walls


Task number 5

  • There is a horizontal wall on the infinite 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 indicated by the letter "P"):

Answer to task number 5

  • nc not yet (bottom free)

paint over

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



Design if

  • top free bottom free left free right free
  • These commands can be used together with the condition "if", having the following form:
  • if condition then
  • command sequence
  • 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

Task number 7

The lengths of the walls are unknown.


Answer to task number 7

until the top is free

paint over

right

while the top is free

right

while the right is free

paint over

right

until the right is free

paint over

way down

while the right is free

way down

until the right is free

paint over

way down


Task number 8

The lengths of the walls are unknown.

There is exactly one passage in each wall, 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

as long as the bottom is free

until the bottom is free

paint over


Task number 9

The lengths of the walls are unknown.

There is exactly one passage in each wall, the exact location of the passage and its width are unknown.


Answer to task number 9

as long as the bottom is free

until the bottom is free

paint over

as long as 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.

There is exactly one passage in each wall, the exact location of the passage and its width are unknown.


Answer to task number 10

while the left is free

until the left is free

paint over

while the left is free

until the left is free

paint over

until the right is free

paint over

while the right is free

until the right is free

paint over


Task number 11

The lengths of the walls are unknown.

There is exactly one passage in each wall, 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

as long as the bottom is free

until the top is free

paint over


Task number 12

There is a staircase on the endless field. The ladder first descends from right to left, then descends 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 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 stairs 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 stairs:

nc while the bottom is free

way down

to the left

to the left

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

nc until left loose

paint over

right

paint over

right

way down



Answer to task number 13

nc while left free

paint over

to the left

up

nc until left loose

paint over

up


Task number 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 the rectangle. The figure shows one of the possible ways to arrange the walls and the Robot (the Robot is indicated by the letter "P").


Answer to task number 14

while the right is free

right

while the top is free

up

paint over

nc while left free

to the left

paint over



Answer to task number 15

while the right is free

paint over

right

as long as the bottom is free

paint over

way down

paint over

not yet (bottom free)

to the left

way down

not yet (right free)

paint over

way down

paint over

right

not yet (top loose)

paint over

right



Answer to task number 16

until the right is free

paint over

way down

paint over

right

until the top is free

paint over

right

while the top is free

up

while the right is free

paint over

right

until the right is free

paint over

way down