Download the Gris Arrow program for computer science. Control structure "cycle"

| Planning lessons for the school year | Graphic training executor

Lessons 4 - 7
Graphic training executor
(§ 4. Graphic training executor)
Working with the educational algorithm executor: constructing linear algorithms





Purpose and capabilities of the graphic artist (GRIS)

Training executors are used to teach how to compose control algorithms.

There are many educational performers designed for computer science classes. They have different, often funny names: Turtle, Robot, Draftsman, Kangaroo, Vacuum Cleaner, Ant, Cucaracha and others. Some performers create drawings on a computer screen, others form words from letter cubes, and others drag objects from one place to another. All these performers are controlled by software. Each of them is characterized by a certain operating environment , control command system , operating modes .

In this chapter, we will not describe in detail how to work with any of the real educational tools listed above (computer classes at different schools may have different software). We will describe a conditional executor that is very similar to some of the existing ones in the main: command system, language and programming techniques.

Many of the training performers draw on a computer screen. Of those named above, these are Turtle, Kangaroo, and Draftsman. This group can be called graphic artists. Let our hypothetical (invented) performer also be from this “company”. Let's call it GRIS, which means “Graphic Artist”.

What can GRIS do? He can move around the field and draw on this field with his tail (let's assume that he has a tail to which a piece of chalk is tied).

The environment in which the performer operates is called executor's environment . The graphical executor environment is shown in the figure below. This is a sheet (screen page) for drawing. The GRIS can move in horizontal and vertical directions with a constant step. The dotted line in the figure shows a grid with a step equal to the performer’s step. The performer can only move along the lines of this grid. The GRIS cannot extend beyond the field boundaries.

The state of the performer on the field is determined, firstly, by his location (at what point on the field he is), and secondly, by the direction (where he is looking). We will determine the direction as on a geographical map: up - north, down - south, left - west, right - east. GRIS can walk or jump along the grid lines, as well as turn. He can only turn counterclockwise.

The graphical executor is a control object. And you and I will manage it. The goal of control is to obtain a specific pattern. It is clear that this drawing can only consist of horizontal and vertical segments; GRIS cannot move in other directions.

The task is usually formulated as follows: the performer is at a given point in the field, looking in a given direction. You need to get a certain drawing. For example: GRIS is located in the middle of the field and faces east. You need to draw the letter “T” with the length of each line equal to four steps.

Initially, the performer is given the initial state. This is done in a special installation mode .

Now let's move on to managing the graphical performer. There are two possible modes here: direct control mode And program control mode .

Simple GRIS commands

Work in direct control mode works like this: a person gives a command, GRIS carries it out; then the next command is given, etc. (as in the example with the owner and the dog).

In direct control mode, the system of performer commands is as follows:

  • step— moving the GRIS one step forward while drawing a line;
  • turn— turn 90° counterclockwise;
  • bounce— move one step forward without drawing a line.

We will call these commands simple commands.

For example, let's say you want to draw a square with a side equal to one step. The initial position of the GRIS is in the lower left corner of the square, the direction is to the east. We will mark the state of the performer with a small arrow. Then the sequence of commands and the results of their execution will be as follows:


Working in program mode

Working in program mode simulates automatic control by the performer. The control system (computer) has a memory into which the program is stored. A person composes a program and enters it into memory. Then the GRIS is put into installation mode and the person manually (using certain keys) sets the initial state of the performer. After this there is a transition to execution mode and GRIS begins to work according to the program. If a situation arises in which it cannot execute the next command (going beyond the field boundary), then the program execution ends abnormally. If an accident does not occur, then the performer’s work ends on the last command.

Thus, the software control of the graphical performer goes through the preparation stage (programming and setting the initial state) and the program execution stage.

In program control mode, the commands step, turn, and jump are still used. However, there are also other commands in this mode. You will meet them later.

The programming language for the graphic artist is the educational Algorithmic Language (AL). Therefore, the GRIS control algorithms written on the AY are also programs for it.

  1. 1. FIGURE PR SHG PV3 SHG NV SHG SHG PV3 PV3 SHG NV SHG SHG PV3 PV3 SHG NV SHG SHG PV3 PV3 SHG NV SHG PV3 PR2 PR D (FIGURE) P (FIGURE) D (FIG) PR KP P (FIG) PR D (ZIG)4 PR2 KP P (ZIG) SHG D (RIGHT) SHG PV SHG D (RIGHT) KP P (RIGHT) PV3 KP ROW D (ROW) P (ROW) PC (NS) D (FIG ROW) CC D (RIGHT ) KP P (FIG ROW) D (FIG) E (NS) PR CV KP FRAME D (FRAME) P (FRAME) D (ROW)4 KP D (RMCYCLE) P (RMCYCLE) PC (NS) D (FIGRAM) CC KP P (FIG) D (FIG) E (NS) PR IN D (RIGHT) KV KP FIELD D (FIELD) P (FIELD) PC (NS) D (ROW) D (RETURN) KC KP P (RETURN) D (RIGHT ) PC (NS) PR KTs PV PR3 E (NS) PR PV HF KP
  2. 2. FOLLOWING PV3 SHG PR turn turn turn step jump PV3 SHG PR Command system SKI) STEP - moving the “Arrow” one step forward while drawing a trail JUMP - moving the drawing of the “Arrow” trail one step forward TURN - turning 90 degrees against clockwise without
  3. 3. FOLLOWING PV3 SHG PR turn turn turn step jump PV3 PROCEDURES beg SQUARE PV3 SHG PR turn turn beginning SQUARE turn body procedures do SQUARE end end SQUARE CYCLE “BYE” while there is NOT a wall ahead nc step jump NS kc yes PC (NS) NC SHG PR CC SHG PR yes no NS PR no PV E (NS) TO PR IN PV KV if there is NOT a wall in front then jump otherwise turn all procedure SQUARE step turn step turn step turn step end of procedure PV3 D (SQUARE) P (SQUARE) SHG PV SHG PV SHG PV SHG KP BRANCHING E (NS) TO PV KV yes NS PV if there is NOT a wall in front then there is no turn
  4. 4. Entering and editing algorithms in the environment of the graphical executor "STRELOCKA" The initial state of the interface of the graphical executor "Strelochka". All control buttons are currently inactive except for the “Start” menu item. To get started, you need to position it with the screen cursor and click the left mouse button. Complete this action.
  5. 5.
  6. 6. After selecting the “Development” menu item, the buttons in the blocks are active: “Command system”, “Procedures”, “Control structures” (to the left of the command input field). The text of the control algorithm is entered by selecting and clicking the corresponding buttons using the mouse. Let's look at a simple example of entering and editing the text of a simple linear algorithm.
  7. 7. The text of the linear algorithm was entered using the buttons from the “Command System” block. The same result can be obtained by pressing the corresponding function keys F2, F3, F4 on the keyboard. In editing mode, it is convenient to use the context menu that appears on the screen if you press the right mouse button. The context menu is shown on the slide. To switch to the algorithm execution mode, select “Debugging”.
  8. 8. The slide shows the result of the algorithm. There are three program test speeds: “slow”, “fast”, “very fast” (the mode switching buttons are located under the menu bar). Nearby there is a red “stop” button to interrupt the algorithm execution process.
  9. 9.
  10. 10. GRAPHIC EDUCATIONAL WORKER “ARROW”. INTERFACE. Command system.
  11. 11. Initial state of the interface of the graphical executor “Strelochka”. All control buttons are currently inactive except for the “Start” menu item. To get started, you need to position it with the screen cursor and click the left mouse button. Complete this action.
  12. 12. State of the graphical executor interface after selecting the “Start” menu item. The “Development” item in the menu bar becomes active. Entering and editing the text of the algorithm for solving educational problems will be possible after positioning the screen cursor on this item and clicking the left mouse button. Complete this action.
  13. 13. After selecting the “Development” menu item, the buttons in the blocks are active: “Command system”, “Procedures”, “Control structures” (to the left of the command input field). The text of the control algorithm is entered by selecting and pressing the corresponding buttons using
  14. 14. TASK: Complete a complex training task in the GRIS “Strelochka” environment, which includes a package of interrelated training tasks built on the basis of a simple graphic element, which we will conventionally call the name “FIGURE”. There can be a lot of options for such a task to control basic skills, and each option is determined by the shape of the original graphic element.
  15. 15. FIGURE Without procedures FIGURE With procedures ROW Cycle + branching FRAME Procedures FRAME Endless loop FIELD Complex task
  16. 16. OPERATING MODES OF THE GRAPHIC EXECUTOR “STRELOCKA” The “Strelochka” performer works only in program mode. The program (algorithm) for Strelochka is written in an educational algorithmic language. You can edit the text of the algorithm on the screen using the context menu.
  17. 17. OPERATING MODES OF THE GRAPHIC EXECUTOR “ARROW” Initial state of the graphic artist (beginning). The “arrow” is at point A, the direction is down. Using the scroll buttons, you can see all the steps of executing the algorithm for solving the educational problem.
  18. 18. OPERATING MODES OF THE GRAPHIC EXECUTOR “ARROW” Execution of the first command “rotate”. The arrow rotates 90 degrees counterclockwise.
  19. 19. OPERATING MODES OF THE GRAPHIC EXECUTOR “ARROW” Executing the “step” command. The “Arrow” performer moves one step to the right and draws a trace (straight line)
  20. 20.
  21. 21. OPERATING MODES OF THE GRAPHIC EXECUTOR “ARROW” Executing the “rotate” command. The arrow rotates 90 degrees counterclockwise.
  22. 22. OPERATING MODES OF THE GRAPHIC EXECUTOR “ARROW” Executing the “rotate” command. The arrow rotates 90 degrees counterclockwise.
  23. 23. OPERATING MODES OF THE GRAPHIC EXECUTOR “ARROW” Executing the “step” command. The “arrow” moves one step down and leaves a mark.
  24. 24. CONTROL AND ALGORITHMS Cybernetic model of control Object (subject) exercising control Control object Object (subject) executing control commands Control object Direct communication Channel for transmitting control commands Feedback Algorithmization Discreteness Automatic systems with program control Understandability Properties of the algorithm State data transmission channel control object Control algorithm SKI - system of executor commands Executor of algorithms Accuracy Finiteness Algorithmic structures Following Branching Cycle Structural method of algorithmization Sequence of control commands Technical systems in which the functions of the control object are performed by a computer Construction of an algorithm from basic algorithmic structures following branching cycle Sequential detailing Main algorithm Auxiliary algorithms Design top down
  25. 25. Symbols in flowcharts Flowchart is a graphical representation of the algorithm. Block - an algorithm diagram consists of figures (blocks) indicating individual actions of the performers, and arrows connecting these blocks and indicating the sequence of their execution. Inside each block, the action being performed is recorded. beginning Abbreviated Algorithmic language (GRIS "Strelochka") record (on paper) command step SHG SHG4 jump jump jump PR PR2 turn procedure step step step turn turn turn PV PV3 call procedure do PROCEDURE_NAME yes NS no procedure PROCEDURE_NAME. . . . . . . . . . . . end of the procedure while there is a wall ahead description of the procedure while there is NOT a wall ahead nc. . . . . . . . . . . . . . . . . . kts end D (NAME) P (NAME) . . . . . . . . KP PC (S) PC (NS) NC. . . . . . . . CC if there is a wall in front if there is NOT a wall in front then. . . . . otherwise. . . . . all that. . . . . . . . . all E (C) E (NS) TO. . . IN. . . HF

GRIS is a complex of calculation programs and includes two autonomous programs: GRIS_S and GRIS_T. The complex's programs allow you to calculate runoff from rain floods and melt water, as well as calculate the capacity of pipes and small bridges.

The scope of application of the programs is the design of roads and railways.

GRIS_S.

The calculation results of the GRIS_S program can be used in the GRIS_T program, designed to calculate the throughput of small artificial structures.

Main functions of the program:

  • calculation of rain flood runoff using the MADI/Soyuzdorproekt formula;
  • calculation of rain flood runoff using the maximum intensity formula SNiP 2.01.14-83;
  • calculation of rain flood runoff using the reduction formula SNiP 2.01.14-83;
  • calculation of rain flood runoff according to VSN 24-87 (calculation based on departmental building standards for Belarus);
  • calculation of rain flood runoff using the formula of UkrNIGMI (Ukraine);
  • calculation of rain flood runoff using reduction formula II SP 33-101-2003;
  • calculation of rain flood runoff using the maximum intensity formula III SP 33-101-2003;
  • calculation of melt water runoff according to SNiP 2.01.14-83;
  • calculation of melt water runoff according to VSN 24-87 (calculation was compiled according to departmental building standards for Belarus);
  • calculation of melt water runoff using the UkrNIHMI formula (Ukraine);
  • calculation of melt water runoff according to SP 33-101-2003.

GRIS_T.

The program allows you to calculate the throughput of small artificial structures: a smooth round pipe, a smooth rectangular pipe, a small bridge, as well as corrugated pipes of various sections. Calculation of single and multi-point pipes is possible.

The advantage of the program is the ability to use not just one, but various methods for calculating runoff and culvert designs, including corrugated ones with different cross-sectional shapes.

The input data for the program can be field survey materials and adopted design decisions. The results of calculations of the GRIS_S program, which serves to determine the flow rates and volumes of runoff from rain floods and melt water, can also be used as input data.

Hydraulic calculations to determine throughput are applicable in the program for both new and existing structures. For the same structure, such a calculation can be performed using different runoff calculations.

Calculation of metal corrugated pipes is carried out using three methods, conventional names of calculations: GOFR_I, GOFR_II, GOFR_III. Each technique corresponds to certain types of cross sections (Fig. 1).Rice. 1.Types of cross sections for the calculation of “Corrugation_II

» (design and construction of structures made of metal corrugated structures on public roads)

In addition to determining the water carrying capacity, the program makes it possible to select the standard dimensions of a new artificial structure based on hydraulic indicators, both taking into account accumulation and without it.

The user can vary the size of the bridge opening and analyze the amount of water pressure in front of it (the technique is used for small bridges).

During the calculation, the following main characteristics are determined:

  • accumulation coefficient (in calculations taking into account accumulation);
  • discharge flow in the structure (in calculations taking into account accumulation);
  • operating mode of an artificial structure;
  • water back-up in front of the structure;
  • depth and speed of water at the outlet of the structure or in the design section;
  • minimum permissible height of the subgrade (for new structures).

The calculation results in the GRIS_T program can be obtained in three forms (Fig. 2, 3):

  • in the form of a visual image displayed on the screen after calculation;
  • in the form of a report (table), which can be previewed on the screen and then printed;
  • in the form of a report file saved on disk in RTF format.

Example of hydraulic calculation of a round pipe:


Rice. 2.Visual image displayed on the screen after calculating a round pipe. The conventional drawing of the longitudinal section displays the depths in various sections, as well as the geometric characteristics of the pipe itself

Example of hydraulic calculation of a small bridge:


Rice. 3.Visual image displayed on the screen after calculating a small bridge

System and technical requirements:

CPU: Intel Pentium 4 1.6 GHz or compatible (Intel Core 2 Duo 2.4 GHz recommended).

RAM: at least 2 GB.

Video subsystem: graphics accelerator based on an NVIDIA GeForce 6600 or ADM Radeon X700 class graphics processor or more powerful.

Operating system:

Microsoft Windows 7 Service Pack 1,

Microsoft Windows 7 x64 Service Pack 1,

Microsoft Windows 8.1,

Microsoft Windows 8.1 x64,

Microsoft Windows 10 x64,

Microsoft Windows 10 x86.

Notes:

To ensure the functioning of the software product, the Echelon II Security System is required, which includes a USB hardware security key. The hardware protection key can be installed either on the same computer where the applications are run, or on one of the computers in the organization’s network. System and technical requirements for Defense Manager Echelon II are .

Strelka is a computer chess program for Microsoft Windows developed by Yuri Osipov. Currently, “Strelka” is one of the strongest programs in the world, including blitz rating lists and the strongest in Russia.

A total of five versions of the program have been developed. The latest Strelka 5.5 program includes only a single-processor version. In the CCRL 40/40 rating dated August 17, 2013, the chess program “Strelka” 5.5 64-bit has 3115 Bayeselo units. In the CCRL 40/4 blitz rating dated August 24, 2013, the Strelka 5.1 64-bit program has 3137 Bayeselo units. In the CEGT 4/40 blitz rating dated August 28, 2013, the Strelka 5.0 x64 1CPU program has 3003 Elo units.

The author of the program, Yuri Osipov, does not claim that the latest version is completely original, since he used many other programs during development: Rybka 3, IPPOLIT, Houdini, Critter and . To the greatest extent this concerned the algorithms of the chess program Houdini 1.5a. However, Strelka 5.0 contains many fundamental differences from other programs. First of all, in the algorithm for searching the evaluation function. Although the evaluation of the current position often produces strange results, its algorithm is based on the chain of moves that led to it.

The GRIS Strelochka program is designed for teaching programming. The utility is implemented in a graphical format, and the commands are specified by the user.

Usage

Install and run the program. The main menu for drawing opens before the user. The arrows can be moved in any direction. The main purpose of controlling the arrows is to achieve a certain pattern. It is worth noting that the picture only includes vertical and horizontal lines.

Possibilities

The program implements 2 main modes: program and direct control. If you choose the second option, then control is carried out according to the following scheme - the user gives a command, and the program executes it. In this mode, you can move the arrows one step, you can also jump, when the arrow jumps one cell without drawing, and rotate the arrow 90 degrees. In program mode, simple commands also remain, but more complex algorithms are added here. For beginners, it is recommended to first master the work in simple mode, and only then move on to the second stage. The main goal of the program is to prepare a person for real programming. The utility is distributed free of charge in Russian.

Key Features

  • the program is compatible with all versions of Windows;
  • a wide range of commands in programming mode;
  • basic control commands - turn, step, jump;
  • the utility has been completely translated into Russian;
  • You can get more information about training in the help menu.