menu
Menu
Drakon.Tech logo
Drakon.Tech
Get started
Drakon.Tech documentationProgramming in DRAKONThe basics of programming with Drakon.TechHello worldVariables and functionsif-else | Question iconswitch-case | the Choice iconThe foreach loopThe arrow (while) loopSilhouetteClassesLambdas and exceptionsAdvanced programming methodsGame examplesThe source codeLegacy tutorials (JavaScript 0.2)

Silhouette

Ru | En

Source code: Silhouette

Silhouette helps the reader understand complex logic

If you ask me about the most remarkable feature of the DRAKON language, I will say "silhouette." With silhouette, long processes become easy to understand.

Flowcharts in Drakon.Tech have the type primitive by default. The "Silhouette/primitive" button on the toolbox toggles the diagram type between primitive and silhouette.

Toggle between silhouette and primitive

A silhouette contains several smaller flowcharts that are called "silhouette branches." Each silhouette branch has a header at the top, a body, and one or more Address icons at the bottom. The rightmost branch is the last branch. The last branch has an End icon at the bottom.

The purpose of a silhouette is to divide a large flowchart into manageable chunks.

Silhouette

Flow direction on a silhouette flowchart

The flow starts at the top of the leftmost branch. We go all the way to the bottom to an Address icon. The Address icon points to the next branch to run. We go through all the branches until we reach the End icon on the final branch.

The convention is to arrange the branches so that they follow from left to right.

Flow direction on a silhouette flowchart

The silhouette loop

It is possible to connect a path from a Question or a Case icon to an additional Address icon, thus grounding the flow on the "floor" of the silhouette. This way, a silhouette branch can get more than one Address icon. When an Address icon points to its own branch or a previous branch, we have a silhouette loop. Drakon.Tech marks silhouette loops with triangles to make cycles apparent.

The silhouette loop

The three questions of the king

One silhouette diagram is more convenient than many disconnected smaller flowcharts. A silhouette breaks up a complex algorithm into logical parts, and yet these parts remain on the same visual scene.

Silhouette diagrams give the reader a quick overview of the algorithm. The layout of a silhouette answers the 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?
The three questions of the king

The Header icon answers the first question. The branch headers answer the two other questions. And the answer comes without delay because the branch headers are always at the top of the diagram, and they are aligned on a horizontal line.

Source code: Silhouette
close
Close
Drakon.Tech logo
Drakon.Tech home
Programming in DRAKONThe basics of programming with Drakon.TechAdvanced programming methodsThe source codeLegacy tutorials (JavaScript 0.2)