Flow and conditions
We have been focusing on sequence so far. With sequence, you can picture instructions flowing through the computer as it executes them one at a time.
Control flow is all about controlling that flow of instructions (hence the name - control flow). Each language has several control flow statements that define a certain flow pattern. Each of these patterns is controlled by a condition which evaluates to true of false - which is known as a boolean value.
Example
using static SplashKitSDK.SplashKit;using static System.Convert;
// You can create boolean variables to store true/false values.// There are also keywords for true and falsebool ready = false;
Write("Enter a number: ");string line = ReadLine();int value = ToInt32(line);
// You can calculate boolean values using comparisons like thisbool bigValue = value > 100;
Write("Is that a big value for you? [y/n]: ");line = ReadLine();
// You can join boolean values using logical operators// It is big for the user if they entered 'y' or 'Y'bool bigForUser = (line == "y") || (line == "Y");
// You can join any boolean value using the logical operatorsbool bigForBoth = bigForUser && bigValue;