DRAKON Visual Language: Tutorial. Part 1
-
Upload
stepan-mitkin -
Category
Education
-
view
14.275 -
download
5
description
Transcript of DRAKON Visual Language: Tutorial. Part 1
![Page 1: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/1.jpg)
DRAKON Visual Language
Tutorial. Part 1:How to draw DRAKON flowcharts
![Page 2: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/2.jpg)
Types of DRAKON diagrams
Primitive
Silhouette
Used for the most simplealgorithms
Recommended for allother algorithms
![Page 3: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/3.jpg)
Primitive
![Page 4: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/4.jpg)
What does a primitive consist of?
![Page 5: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/5.jpg)
What does a primitive consist of?
A vertical skewer
![Page 6: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/6.jpg)
What does a primitive consist of?
The header
![Page 7: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/7.jpg)
What does a primitive consist of?
The algorithm
![Page 8: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/8.jpg)
What does a primitive consist of?
The “End” icon
![Page 9: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/9.jpg)
“Action” icon
An “Action” icon
![Page 10: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/10.jpg)
“Action” icon
an order to do something
![Page 11: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/11.jpg)
The skewer must be vertical
![Page 12: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/12.jpg)
Wrong!
![Page 13: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/13.jpg)
Wrong again
● Use lines instead of arrows● Arrows create visual noise
In DRAKON,the next icon is always below
![Page 14: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/14.jpg)
Even worse● It is not allowed to break the skewer
![Page 15: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/15.jpg)
“Insertion” icon
It is a reference
to an algorithm
that is defined elsewhere
![Page 16: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/16.jpg)
“Insertion” icon
![Page 17: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/17.jpg)
“If” icon
![Page 18: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/18.jpg)
“If” icon
Contains a questionthat can be answered
“yes” or “no”
![Page 19: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/19.jpg)
The happy path goes straight
The happy pathis the most successful
and desirable route
![Page 20: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/20.jpg)
The unlucky scenario goes to the right
![Page 21: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/21.jpg)
The further to the right,the worse it is
![Page 22: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/22.jpg)
Good
Bad
Worst
![Page 23: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/23.jpg)
Wrong
The happy path
is broken
![Page 24: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/24.jpg)
Right
The happy path
is straight
![Page 25: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/25.jpg)
Visual noise is bad
Too many angles
![Page 26: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/26.jpg)
Horizontal joining
The problem is solved
![Page 27: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/27.jpg)
Repetition is bad
![Page 28: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/28.jpg)
Vertical joining
Removes repetition
![Page 29: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/29.jpg)
Line intersectionsare forbidden
![Page 30: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/30.jpg)
Intersections kill readability
![Page 31: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/31.jpg)
Silhouette
The recommended type of diagrams
![Page 32: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/32.jpg)
What can silhouette do?
● It can cleanly split the diagram into logical parts
● It can represent a finite automaton (state machine)
● It helps get rid of line intersections in complex algorithms
![Page 33: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/33.jpg)
What does a silhouette consist of?
![Page 34: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/34.jpg)
The header
![Page 35: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/35.jpg)
The branches
![Page 36: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/36.jpg)
What does a branch consist of?A header with
the branch name
![Page 37: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/37.jpg)
What does a branch consist of?
The algorithmof the branch
![Page 38: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/38.jpg)
What does a branch consist of?
The addressof the next branch
![Page 39: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/39.jpg)
Silhouette answersthe three questions of the king:
1. What is the name of the problem?
2. How many parts does the problem have?
3. What are the names of the parts?
![Page 40: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/40.jpg)
1. What is the name of the problem?
![Page 41: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/41.jpg)
2. How many problems does the problem have?
![Page 42: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/42.jpg)
3. What are the names of the parts?
![Page 43: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/43.jpg)
The leftmost branch is run first
![Page 44: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/44.jpg)
Then follow the other branches
![Page 45: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/45.jpg)
The rightmost branch goes last
![Page 46: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/46.jpg)
There can be only one“End” icon
on the DRAKON diagram
![Page 47: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/47.jpg)
The order of branches is defined in the “Address” icons
![Page 48: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/48.jpg)
The branches should by sorted left-to-right
![Page 49: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/49.jpg)
When is it allowed to go to the left?
1. When some branches need to be repeated.
2. When the diagram represents a finite automaton (state machine).
![Page 50: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/50.jpg)
A branch can have several “Address” icons
The algorithm of such branchdecides which branch to run next
![Page 51: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/51.jpg)
A direct jump from one branch to another is forbidden
![Page 52: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/52.jpg)
Icon “Select”
Contains a question:● that cannot be answered “yes” or “no”● that can have several answers
![Page 53: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/53.jpg)
Icon “Select”
![Page 54: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/54.jpg)
How to arrange the answers?
● Following the principle “The further to the right, the worse it is”
or● Following the principle “The further to the right, the
larger it is”
or● Following the principle “The further to the right, the
higher it is”
or...
The key thing is to sort the answers
![Page 55: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/55.jpg)
The further to the right, the larger it is
![Page 56: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/56.jpg)
Loops
![Page 57: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/57.jpg)
Lift the weight while not tired
![Page 58: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/58.jpg)
The body of this loopis run at least once
![Page 59: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/59.jpg)
Hungry?
If yes, theneat a hamburgerstart from the
beginning
If no, then leave
![Page 60: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/60.jpg)
This loop is skipped if the condition is not met
![Page 61: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/61.jpg)
The loop condition is inside the loop body
![Page 62: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/62.jpg)
“For each” loop
![Page 63: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/63.jpg)
There can be several exits from a loop
![Page 64: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/64.jpg)
There can be only ONE ENTRANCEinto a loop
Wrong!A second
entrance isnot allowed
![Page 65: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/65.jpg)
Silhouette loop: some branches are run several times
![Page 66: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/66.jpg)
Silhouette loop: some branches are run several times
Loop branches are markedwith black triangles
![Page 67: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/67.jpg)
“Select” loop
![Page 68: DRAKON Visual Language: Tutorial. Part 1](https://reader034.fdocuments.us/reader034/viewer/2022052316/5596fd611a28abad778b45e7/html5/thumbnails/68.jpg)
Stepan Mitkin
The diagrams on the slides were made with DRAKON Editor
http://drakon-editor.sourceforge.net/
June 2013
End