Skip to content

Control structures

Condition

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Struct Color
    name: string
    rgb: number[3]
End

Struct PaintingResult
    wetness: number
End

Struct SheetPart
    width: number
    hight: number
End

Struct CuttingResult
    parts_count: number
    sheet_parts: SheetPart[]
End

Task productionTask
   Painting
        In
            Color 
            {
                "name": "green",
                "rgb": [0, 255, 0]
            }
        Out
            pr: PaintingResult

    Condition
        pr.wetness > 10
    Passed
        Drying
            In
                pr
End

Counting loop

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Struct Color
    name: string
    rgb: number[3]
End

Struct PaintingResult
    wetness: number
End

Struct SheetPart
    width: number
    hight: number
End

Struct CuttingResult
    parts_count: number
    sheet_parts: SheetPart[]
End

Task productionTask
    Cutting
        Out
            cr: CuttingResult
    Loop i To cr.parts_count
        Milling
            cr.sheet_parts[i]
End

While loop

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Struct Color
    name: string
    rgb: number[3]
End

Struct PaintingResult
    wetness: number
End

Task productionTask
    Painting
        In
            Color 
            {
                "name": "green",
                "rgb": [0, 255, 0]
            }
        Out
            pr: PaintingResult

    Loop While pr.wetness > 10
        Drying
            In
                pr
            Out
                pr: PaintingResult
End