The Wildcats drill selector chooses one instruction from a drill name. Translate the source into one selection with named routes, then check that the chosen route leaves the switch.
The code below uses the same soccer rule as the C# lesson. Read that lesson if the control statement is unfamiliar.
The string input drill already exists inside the method. This excerpt stores the chosen text in instruction.
string instruction;
switch (drill)
{
case "Pass":
instruction = "Pass to a teammate";
break;
case "Shoot":
instruction = "Shoot at the goal";
break;
default:
instruction = "Choose a supported drill";
break;
}Look at the drill name
Pass: select Pass to a teammate, then leave the selection
Shoot: select Shoot at the goal, then leave the selection
Otherwise: select Choose a supported drill, then leave the selection
Continue after the selectionPseudocode describes the behavior without requiring C# punctuation. Preserve the order, alternatives, and repetition when you simplify the wording. Draw the actions and questions; braces and semicolons do not become nodes.
The switch selector becomes one decision diamond. Case values and default label its outgoing arrows; each assignment becomes an action on the corresponding route. The arrows leaving those actions represent the switch breaks.
Drill?. Add outgoing arrows labeled Pass, Shoot, and default. Here default means every value with no named match, including pass and an empty string.Pass to an action labeled Select Pass to a teammate. Connect Shoot to Select Shoot at the goal. Connect default to Select Choose a supported drill.Trace Shoot from the selector to its instruction and then to the merge. Next trace lowercase pass: it follows default because it does not exactly match Pass. Each path visits only one instruction action.