Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Break Statement

From Groundhog Learning

A command that immediately exits a loop, regardless of its condition.

Details

The break statement is useful when you want to stop a loop early.

🤖 Pseudocode

while playerIsAlive
    if playerQuits
        exit game
    run game logic

After break, the program continues with the first statement after the loop.

Related Concepts

Related Actions

References