Brass Core Plugins

while/rept/for/loop

Repeats a series of statements in a loop.

Syntax

.while condition
	[statements]
.loop
.rept count
	[statements]
.loop
.for variable is start to end [step step]
	[statements]
.loop
.for setup, condition, increment
	[statements]
.loop

Remarks

Both a C-style for-loop and a BASIC-style for loop are provided.

Examples

C-style for-loop.

.for i = 0, i < 10, ++i
    .echoln i
.loop

BASIC-style for-loop.

.for i is 10 to 1
    .echoln i, "..."
.loop

.echoln "Blast off!"

Outputs a 5x5 grid of '#' symbols.

#rept 5
    .rept 5
        #echo "#"
    .loop
    .echoln
#loop