View Full Version : Loop

08-06-2011, 07:10 AM
I want to know about loop

08-06-2011, 12:23 PM
A loop should be pretty self-explanatory but what it does is check a condition seeing if it is true. If it is then it does the below code. Once it finishes it goes back up to the condiotion and checks to see if it is true, then does the code, then checks conditon. It will continue to do this until the conditon is false. Now in Alice there are two types of loops, the while and for-loop. The for loop tile looks like this:


where as the while loop looks like this:


Here is what is called a flow chart that explains very simply how a while loop works:

Here is a flow chart for the for-loop:

Now to actually see real parts of the for-loop click on "view complex verison" of the loop tile after you have dragged it into your method.