DynLex Sections

While Loop

Use a while loop when you want to repeat a section while a condition stays true.

Pattern
[loop |]while condition:

This is the exact pattern from std.dl. Both while condition: and loop while condition: are valid.

Example
import lib/std.dl

set count to 1

while count <= 3:
    print count as line
    increment count

DynLex checks the condition before each round. When the condition becomes false, the loop stops.

Try yourself

Change 3 to 5. Then change the start value to 2.