ReferenceVerse
Map Lookup
map lookup
Updated
map-lookup in ~90 seconds.One glance at the sunlit obsidian bounty board in Buccaneer's Arena, and the captain instantly knows Redbeard's exact gold payout without counting the pile.
A Verse map acts just like that board, linking a unique pirate's name directly to their bounty so you can pull the exact number in a single, lightning-fast step.
We define our Bounties map with names and gold, then use an if statement to safely look up Redbeard's key and unwrap his 500 gold.
Reach for a map lookup whenever you need to instantly fetch a specific value tied to a unique key, like player scores or arena loadouts.
Bounties : [string]int = map{"Redbeard" => 500, "Skull" => 250}
if (Gold := Bounties["Redbeard"]):
Print("Bounty: {Gold}")
Build your own lesson with map-lookup
Generate a personalized, compile-checked lesson grounded in this exact reference.
Build a lesson →