This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:programming:algorithms [2012/05/28 09:39] – raivo.sell | en:programming:algorithms [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Algorithms and Flowchart====== | + | ====== Algorithms and flowchart====== |
- | <note important> | + | The algorithm is a step-by-step instruction, |
- | + | ||
- | The algorithm is a step-by-step instruction, | + | |
| | ||
Simplified flowchart elements: | Simplified flowchart elements: | ||
- | ===== Start ===== | + | ==== Start ==== |
Circle. | Circle. | ||
Line 13: | Line 11: | ||
{{: | {{: | ||
- | ===== End ===== | + | ==== End ==== |
Filled circle inside bigger circle. | Filled circle inside bigger circle. | ||
Line 19: | Line 17: | ||
{{: | {{: | ||
- | ===== Action or expression | + | ==== Action or expression ==== |
Rectangle. Inside rectangle a name of the action, name of the sub-routine or short description can be written. Similar actions can be included into one general action. | Rectangle. Inside rectangle a name of the action, name of the sub-routine or short description can be written. Similar actions can be included into one general action. | ||
Line 26: | Line 24: | ||
- | ===== Sequence | + | ==== Sequence ==== |
Arrow, by pointing next activity. | Arrow, by pointing next activity. | ||
Line 32: | Line 30: | ||
{{: | {{: | ||
- | ===== Condition / Decision | + | ==== Condition / Decision ==== |
Diamond (rhombus). Inside diamond is a logical expression and in most cases two arrows are drawn out from diamond. One is when logical expression results True (Yes/1) and other when expression result is False (No/0). Always both arrows have to be labeled. In special case only one arrow can be used as output from diamond. The case is when logical expression can clearly result only one solution, e.g. True. This is the case where for example endless cycle is used in program code (e.g. //while (true)// | Diamond (rhombus). Inside diamond is a logical expression and in most cases two arrows are drawn out from diamond. One is when logical expression results True (Yes/1) and other when expression result is False (No/0). Always both arrows have to be labeled. In special case only one arrow can be used as output from diamond. The case is when logical expression can clearly result only one solution, e.g. True. This is the case where for example endless cycle is used in program code (e.g. //while (true)// | ||
Line 38: | Line 36: | ||
{{: | {{: | ||
- | ===== Data exchange | + | < |
+ | ==== Data exchange ==== | ||
Trapezoid. Inside trapezoid a name or activity is described. In robotics it is usually used to communicate with sensors and user. For simplification also normal rectangle action can be used instead of trapezoid. | Trapezoid. Inside trapezoid a name or activity is described. In robotics it is usually used to communicate with sensors and user. For simplification also normal rectangle action can be used instead of trapezoid. | ||
- | {{:method:algorithms:andmevahetus.png|}} | + | {{:images:programming:data_exchange.png|}} |
- | ===== Examples | + | ==== Examples ==== |
Drawing flowchart diagrams one can use common office suits like MS Word or MS Excel or OpenOffice/ | Drawing flowchart diagrams one can use common office suits like MS Word or MS Excel or OpenOffice/ | ||
- | Flowchats | + | Flowcharts |
- | + | < | |
- | Follwing | + | Following |
{{: | {{: | ||
- | + | < | |
- | Following example | + | Following example |
{{: | {{: |