Verse Library verse

02 Fragment

Calls a health-based loot function with different player health values to initialize loot variables.

verse-library/basics-of-writing-code-8-how-input-parameters-and-arguments-work-in-verse/02-fragment.verse

# Simulate NoobSlayer's state
noob_health : float = 20.0
noob_loot : string = GetLootForHealth(noob_health) 
# Result: noob_loot is "Shield_Potion"

# Simulate TankMode's state
tank_health : float = 90.0
tank_loot : string = GetLootForHealth(tank_health)
# Result: tank_loot is "Assault_Rifle"

Comments

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