Cicada’s for loop is simpler and offers less control than C’s. Here is an example showing the syntax.
counter :: int
for counter in <1, 10> print(counter, " ")
Notice that we had to define the loop variable before the loop, as either an int or a double.
As always, we can break a loop over two lines using a ‘&’, and we can group several lines of code using parentheses beginning on the line of the for command. So we could have rewritten our code above in several different ways.
counter :: int
for counter in <1, 10> &
print(counter, " ")
for counter in <1, 10> (
print(counter)
print(" ")
)
There is no step argument to control the increment of the counter variable, due to limitations of the compiler. For a step of -1 use backfor, otherwise you need a while loop.
counter := 1
while counter <= 10 do (
print(counter, " ")
counter = that + 2
)
Last update: November 12, 2025