Loop
Loop
Function
loop is used to repeatedly execute a section of code. BT provides three types of loops: for supports times, intervals, infinite loops and set traversals, while loops based on conditions, and loop is reserved as a compatible infinite loop writing method.
Loop control
-
break: End the current loop. -
continue: Skip the current round and enter the next round. -
break:label/continue:label: Control loops of specified tags in nested loops.
Examples
for index, value in [1, 2, 3] { if value == 2 { continue } println value }