25% off

Use code FUNCMAIN at checkout for 25% off all premium courses.

Get started →

Interactive Go · Lesson

Quest: The Character Sheet

Time to put your training to the test, adventurer. You’ve learned short variables, long-hand var declarations with explicit types, and constants. This quest combines all three.

fmt.Printf lets you build a formatted string using verbs: %s for strings and %d for integers. End with \n for a newline.

fmt.Printf("%s dealt %d damage\n", attacker, damage)

Your Quest

Using the name, class, level, and startingGold values already defined, print a single line that reads exactly:

Elara the Mage (Level 3) - Gold: 100

Hint

One fmt.Printf with the format string "%s the %s (Level %d) - Gold: %d\n" and the four values in order does the job.

Additional Scrolls of Wisdom