Click on canvas to draw rectangles.
for(i=1; i <= 10; i++) {
instructions
}
Effect: repeat 10 times the instructions
i variable of the cicle. Every cicle
it increments by 1, as effect of i++
for is a cicle with variable
<= less or equal.
Attention !
=< syntax error !!!
<= correct
Cicle will continue until i <= 10 |
Numbering from 0
for(i=0; i < 10; i++) {
instructions
}
Infinite cicle
for( ; ; ) {
instructions
}
|
|
Exercise: makes smaller to draw 20. Exercise2: a second row. |