By Stepan Mitkin
Part 4 of 10
The "If" icon is good for questions that can be answered "yes" or "no". For example:
But not all questions are so simple. There are questions that may have multiple answers. For example:
The common thing about such questions is that they split one algorithm path into several. DRAKON handles multiple choice questions with the "Switch" construct. The "Switch" construct consists of one "Switch" icons and several "Case" icons.
The rightmost "Case" icon can be empty. An empty "Case" icon means "all other values". It is similar to the "default" clause of "switch" statements in procedural languages.
"The further to the right ⎯ the worse" rule also applies to the "Switch" construct.
If some branches are worse than others, the "Case" icons should be sorted left-to-right.
The "Case" icon that corresponds to the luckiest scenario should be at the left.
The worst "Case" will be the rightmost one. This is similar to how the "If" exits are arranged.
Regardless of the way of branching, the happy path goes on the main vertical and error handling is placed on the right side.
Sometimes all branches are equally good. In this situation the "Case" icons should be sorted by the ascending order. Then the rule becomes "the further to the right ⎯ the greater". Depending on the problem, other rules could be devised.
The key thing to remember is to sort the "Case" icons in some monotonous way.
Contact: drakon.editor@gmail.com