Alterna · учебный материал
Robot cycles and conditions
Short theory of cycles, conditions, and environmental sensors for performer Robot.
Что в этом материале
- Mini Language
- How to Think Common algorithm
- Sensor
- Condition
- Cycle
- Boundary
- Where to practice
Содержание и основные понятия
The command sequence is determined by one private route. For the program to operate in different fields, it needs to read the sensor and repeat the action as long as it makes sense to continue.
Cycles and conditions
Ku Mir
EEG 15 framework
01
Mini Language
алг имя · нач · кон
каркас программы
нц 4 раз · кц
повторить известное число раз
нц пока справа свободно · кц
повторять до стены
если сверху свободно то · иначе · все
выбрать один из маршрутов
First, syntax.
Lost
кц
or
все
does not start the program in part: first the whole structure is checked.
02
How to Think Common algorithm
Sensor
The right is free to check the current cell, not guess the way ahead.
Condition
The true condition is that the branch "that", the false branch "the other", or nothing, is fulfilled.
Cycle
The body must change the situation, otherwise the condition may remain true indefinitely.
Boundary
Check the short corridor, the long corridor, and the time when it's impossible to move at once.
03
Where to practice
The theory does not turn into an editor. Multimedia programs, error correction and results testing are collected in
Workshop
.