The Wildcats application chooses a message based on whether a player is available. This page represents a single if/else choice; the filename is retained for existing links.
This excerpt is inside an existing method with Boolean input isAvailable. The two assignments are the complete modeled work.
If the underlying C# feature is unfamiliar, use the lesson below while reading this example.
string message;
if (isAvailable)
{
message = "Ready for practice";
}
else
{
message = "Wait this round";
}Ask whether the selected player is available
If true, store Ready for practice
Otherwise, store Wait this round
Continue after the one selected branchUse these words to follow one execution before drawing it. Keep the same order and the same alternatives as the source; simplify the wording without adding work that the code does not perform.
Player available?.Set message to Ready for practice and Set message to Wait this round.true from the diamond to Ready for practice and false to Wait this round. Do not put an else question between the diamond and the false action.Compare this reference with the diagram you built in Violet. Layout may differ; the source meaning, labels, and relevant connections should agree.
True visits only the Ready assignment. False visits only the Wait assignment. If the source had no else, the false route would bypass the assignment and still continue after the if.