Loops loops loops

--Originally published at Welcome to the Heaven

Okay in this post I am going to show you how it loop “while” works. I have a old post that has another example of the loop “while” if you want to see it, click in more loops or for a different example in frutilupis.

The loop “while” is a kind of loop that allows repeat all the instructions of the code that are inside it. The way to work of this loop is that when the conditional is true, all the instructions can run.

Let’s see an example:

screen-shot-2016-10-28-at-2-35-13-pm

As you can see if the answer of the input “shoot” is yes you get in in the loop and when you are inside it, the program show you a message and a question if you want to stay inside or go out so if you say “yes” all the time, the loop will never end.

screen-shot-2016-10-28-at-2-40-34-pm
As the program runs