pxt-calliope/docs/reference/loops/for.md
2016-05-24 12:30:31 -07:00

25 lines
467 B
Markdown

# For
### @parent blocks/language
Run part of the program the number of times you say.
### Example: Count to 4
This program will show the numbers 0, 1, 2, 3, and 4 one after another on the LED screen.
```blocks
for(let i = 0; i < 5; ++i) {
basic.showNumber(i)
}
```
### Lessons
[looper](/lessons/looper)
### See also
[repeat](/reference/loops/repeat), [while](/reference/loops/while), [if](/reference/logic/if), [show number](/reference/basic/show-number)