PROGRAMMING LOOPs: FOR-NEXT & WHILE
Task: REPEAT SOME INSTRUCTIONS
- If we want to repeat some programming instructions for several times we can use For-Next Loop.
- For example the next program repeats functions
robotLeft()
androbotRight()
for10 times
and robot will do a funny "dancing" move.
{#fig:for_next_loop}
- Experiment a bit more with such programming techniques.
Questions:
- What is a programming loop?
- Name a situation where programming pool is used.
Summary:
Repeating Code in Functions
Using functions may not seem to be very convenient. But it is a huge deal, and helps to make a clean code. It is advised to use functions ether if the code is used only once.
Where the code is repeated several times in different occasions in the program the use of the functions is trivial.
Issues:
<++>
<++>