Verse Library verse

07 Failure Contexts

Demonstrates multi-line if conditions and branching logic to control program flow based on multiple values.

extracted-snippets/documentation/en-us/uefn/learn-code-basics-9-failure-in-verse/07-failure-contexts.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/learn-code-basics-9-failure-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/learn-code-basics-9-failure-in-verse.md
# Section:    Failure Contexts
MousetrapsSet:int = 5
var MiceCaught:int = 0
var BreakTime:logic = false

if:
    MousetrapsSet > 0
    set BreakTime = true
    MiceCaught > 0

if (BreakTime?):
    Print("Take a break!")
else:
    Print("Catch some mice!")
Copy full snippet

Comments

    Sign in to vote, comment, or suggest an edit. Sign in