You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Continue
The continue keyword is used to jump back to the start of a loop
for(i usize = 0; i < 5; i++){
if i == 3, continue
print(i)
}
0
1
2
4
5
Loop Labels
A specific loop can be specified using loop labels
each outer_loop : enemy Enemy in enemies {
each stat Stat in enemy.stats {
if stat.kind == StatKind::IS_INVINCIBLE, continue outer_loop
}
if enemy.health <= 0 {
enemies.remove(idx--)
}
}