Skip to content
mouse114514 edited this page Sep 12, 2026 · 1 revision

For Loop (From ... To)

For Loop

Overview

Uses a loop variable that increments from a start value to an end value (inclusive), running the inner statements each iteration.

Slots

Slot Type Description
VAR String slot (text field) loop variable name (default i); read it inside the loop with a variable value block
FROM Number slot start value
TO Number slot end value (inclusive)
SUBSTACK Statement slot loop body

Connections

Connection Type Description
Top Statement connects after a previous statement
Bottom Statement continues to the next statement

Generated Code

Emits for (int <var> = <from>; <var> <= <to>; <var>++) { ... }.

Example

for i from 1 to 5
└── talk "Round "[i]

Block ID: cu_for_loop


中文 | Flow Control Blocks | Block Reference

Clone this wiki locally