Verse Library verse

03 Using Multiple Conditions

Declares variables, applies conditional logic, and prints a formatted string to the console.

extracted-snippets/documentation/en-us/uefn/learn-code-basics-4-writing-simple-code-in-verse/03-using-multiple-conditions.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/learn-code-basics-4-writing-simple-code-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/learn-code-basics-4-writing-simple-code-in-verse.md
# Section:    Using Multiple Conditions
var Tired: logic = false
var SchoolTomorrow: logic = true
var WhatToWatch: string = "nothing"

if (Tired? or SchoolTomorrow?):
	set WhatToWatch = "your eyelids"
else:
	set WhatToWatch = "cartoons"

Print("You should watch {WhatToWatch}")

# You should watch your eyelids
Copy full snippet

Comments

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