Skip to main content

Repeat Times

Repeats the procedure(s) a specified number of times.

Repeat Times block

Description​

The Repeat Times block repeats the procedure(s) a specified number of times. This is a code block from the Logic drawer.

Usage​

Repeats the procedure(s) a specified number of times.

Syntax​

Inputs in this block:

  • A number

Example​

In this model each agent leaves a stamp of a color which is repeated 15 times before it moves to the next color and repeats. Note that without the use of the yield statement the instructions would be completed in one tick of the clock.

Repeat Times example code
  • While - Repeats while a condition is true
  • Yield - Pauses execution for next tick