This is your first visit inside The Matrix. Welcome!

The Matrix has you…

This place will take you into the mirage of learning C# programming language, without any previous coding experience being required

Follow the White Rabbit…█

Close
Wednesday, September 20, 2017 16:30

Continue operator

January 16th, 2017

In the last article, we spoke about the Break operator being used to immediately stop a loop and continue the execution with the statements that follow after the loop. The Continue operator works somehow in the same way, with the only difference that it will only make the execution skip the current iteration of the loop.… Read more

Break operator

January 16th, 2017

The break operator is used whenever we want to end a loop immediately, even before ending its execution in a natural way. Whenever the Break operator is met, the execution of the loop is immediately stopped and the program continues executing the first instruction that follows after the loop.… Read more

Foreach loop

January 14th, 2017

The Foreach loop is significantly more simpler than the For loop, but it’s also harder for the readers of this blog, since it’s based on concepts we haven’t learned yet. For this reason, i will simply tell you that a Foreach loop was designed to iterate through all elements of an array, list or any other collection of elements that implement iEnumerable interface.… Read more

For loop

January 14th, 2017

For loop is a kind of repeating code construct which is a bit more complex than the previous types of loops we learned so far. On the other hand, they can solve more complicated tasks, with less code involved.

The syntax of the For instruction is the following:

for (start_value; end_condition; increment_value)
{
    instructions;
}

When the program repeats (cycles) the instructions for a certain number of times, you will usually use a variable called control variable, which indicates how many times you executed the instructions.… Read more

Do While loop

January 13th, 2017

The Do While loop is used any time we want to make sure that the instructions will be executed at least once, even if the condition of the loop evaluates as False. As we learned in the previous lesson, a loop is a construct that lets us run one or more instructions repeatedly, until a condition is evaluated as False.… Read more

While loop

January 13th, 2017

Loops are a special kind of instructions that repeat a piece of code a specific number of times or until a special condition becomes True. There are also loops that never end, called infinite loops, and they are rather errors than useful code.… Read more

Conditional statement Switch

January 9th, 2017

As we will see, conditional statement Switch works very much like the If-Else If-Else statement, with only a syntax difference. It executes an instruction based on the calculated value of a condition. The format of the Switch statement is the following:

switch (condition)
{
   case value1:
      instructions;
      break;
   case value2:
      instructions;
      break;
   case value3:
      instructions;
      break;
   //...
Read more

Nested If statements

January 8th, 2017

Sometimes in your programs, you will need to perform checks inside other checks. These kind of conditional processing are called nested If statements or nested If-Else statements.

In common words, nesting is the process of placing a concept inside another concept.… Read more

Conditional statement If-Else

January 8th, 2017

In addition to If, C# offers conditional statement If-Else. When I explained the If statement, I was saying that the program will execute the instructions only if the If condition is True. What if we wanted to execute a total different condition when and only when that condition is False?… Read more

Testing a condition with If

January 7th, 2017

As previously stated in our lessons, as your programs will become more and more complex, they will perform a set of instructions when a condition is True, and another one when is False. When your program executes a conditional processing, you will be testing a condition with If.… Read more