← back to unit
Challenge
# puzzle gauntlet advanced
The Treasure Map Decoder
The pirate map is a string of symbols, and the legend explains each one. Follow it to the treasure! 🗺️
You get the legend as symbol:direction pairs (directions are north/south/east/west) and the clue — a string of symbols. Start at (0, 0); north adds to y, east adds to x. Print x <final x> y <final y>.
Example:
Input: legend = "A:north,B:east", clue = "ABBA"
Output: x 2 y 2
A moves north (y+1), B moves east (x+1). So ABBA gives y+1 (A), x+1 (B), x+1 (B), y+1 (A) — ending at x=2, y=2.
💡 need a hint?
pg-treasure-map.py🔒 given lines are locked — write your code in between
loading...