The Loop Command

In this chapter we are going to learn about the The Loop Command

Introduction

We can create this program quickly using the Quick Start component

ib_quickstart_theloopcommand.png

Program Steps

After selecting the (The Loop Command) template, we will get the next steps in the Goal Designer

gd_quickstart_theloopcommand.png

Creating the Program

To create this program we will use the next components

  • For Loop

  • If Statement

  • Print Text

  • Loop

In the begining the Steps Tree is empty

1.png

Using the (For Loop) component we will create a loop from 1 to 10

The loop will use the X variable

2.png 3.png 4.png

Using the (If Statement) component we will check if X=3

When this happens, we will print the (Three) message

5.png 6.png 7.png 8.png 9.png 10.png

Using the (Loop) component, we will pass the next instructions in the loop

i.e. We will move to the next iteration in the loop

11.png 12.png 13.png

Using the (Print Text) component we will print the (X) variable

14.png 15.png

Now we have the final Steps Tree in our program

16.png