pxt-calliope/docs/reference/loops/for.md
2016-06-11 22:28:57 -04:00

427 B

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.

for(let i = 0; i < 5; ++i) {
basic.showNumber(i)
}

See also

repeat, while, if, show number