PDA

View Full Version : Loop


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

legolizard
08-06-2011, 11:23 AM
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:

5340

where as the while loop looks like this:

5339

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

Here is a flow chart for the for-loop:
5343

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.