# Flow > Loops

## Definite Loops

### Repeat

Repeats the wrapped blocks a given number of times. The embedded `current loop count` block returns how many times you've looped so far (starting from 0, ending at [NUMBER] - 1).

``````for(index0 in 0...[INT]) {
[ACTIONS]
}``````

#### Example

Prints out [0 1 2 3 4].

## Indefinite Loops

### While Loop

Runs the wrapped blocks while the given condition is `true`. If the condition is `false` to begin with, nothing will run. Make sure that the condition becomes `false` at some point during the evaluation of the loop (or use the `exit loop` block), otherwise it will result in an infinite loop that will crash your game.

``````while([BOOLEAN]) {
[ACTIONS]
}``````

### Repeat Until Loop

Runs the wrapped blocks while the given condition is `false`. If the condition is `true` to begin with, nothing will run. Make sure that the condition becomes `true` at some point during the evaluation of the loop (or use the `exit loop` block), otherwise it will result in an infinite loop that will crash your game.

``````while(![BOOLEAN]) {
[ACTIONS]
}``````

#### Example

This will calculate Fibonacci sequence numbers until the current number is greater than 10.

Prev 1 -
Curr 1 -
1 1 + 1 2
2 1 + 2 3
3 2 + 3 5
4 3 + 5 8
5 5 + 8 13 <-- Greater than 10, stop looping.

## Branching

### Exit Loop

Stops the execution of a loop's code.

``break;``

Skips the rest of the code for an iteration of the loop and proceeds to the next iteration (if another iteration will be done).

``continue;``

#### Example

The loop prints out odd numbers between [0-9], so this will print out [1 3 5 7 9].