topskill.dev
CoursesTracks
0
All courses/Python Basics: The Lantern AtlasProject: Unlock the Exit Gate
Level 3: Gate Trials — Decisions and Loops
11 / 12
← Python Basics: The Lantern Atlas
○Level 1: Spawn Camp○Demo: Light the Camp Message○Exercise: Open the Lantern Map○Code Comments○Demo: Name a Map Location○Exercise: Label a Beacon○Variable Types○Demo: Inspect Lantern Types○Exercise: Pack Starting Supplies○Optional: Set up Python Locally✦Module Quiz
○Demo: Divide Beacon Shards○Exercise: Price a Cache Route○Demo: Format a Gear Label○Exercise: Format Forge Readouts○Demo: Convert Shard Text○Exercise: Convert Charge Readings○Demo: Read a Pathfinder Name○Project: Build Adi’s Gear HUD✦Module Quiz
○Demo: Compare Workshop Supplies○Exercise: Check Gate Supplies○Demo: Choose a Lit Route○Choose a Gate Signal○Demo: Pulse a Beacon with while○Exercise: Recharge the Beacon○Demo: Mark a Route with range○Exercise: Label Even Patrols○Demo: Skip a Hazard, Stop at a Gate○Exercise: Cross Safe Tiles●Project: Unlock the Exit Gate✦Module Quiz
○Define a Beacon Ability: Demo○Exercise: Activate a Beacon○Pass Energy and Return a Result: Demo○Exercise: Combine Beacon Energy○Default Ability Marks: Demo○Exercise: Name a Beacon Ability○Local Energy Scope: Demo○Exercise: Spend Local Energy○Project: Build an Ability Loadout✦Module Quiz
○Read a Rune Code: Demo○Exercise: Read Rune Edges○Slice a Cavern Route: Demo○Exercise: Decode Route Fields○Clean a Rune Message: Demo○Exercise: Decode a Rune Notice○Format a Route Card: Demo○Exercise: Write a Decoded Route Sign✦Module Quiz
○Index a Gear List: Demo○Exercise: Build a Gear Queue○Change a Gear List: Demo○Exercise: Repair the Loadout○Slice a Ridge Route: Demo○Exercise: Pack for Checkpoints○Read a Fixed Checkpoint Record: Demo○Exercise: Read an Exit Checkpoint✦Module Quiz
○Read an Atlas Map Card○Exercise: Update a Map Entry○Loop Through Beacon Map Entries○Exercise: Count Cache Marks○Count Unique Atlas Stops○Exercise: Compare Atlas Routes○Demo: Summarize Beacon Finds○Exercise: Build the Atlas Treasure Index✦Module Quiz
○Recover a Faded Beacon Reading○Exercise: Label Beacon Charge○Demo: Write a Shrine Save○Exercise: Save a Beacon Signal○Mini Project: Restore the Save Shrine✦Module Quiz
○Demo: Calculate Beacon Capacity○Exercise: Calculate Lantern Capacity○Demo: Import a Local Beacon Rule○Exercise: Import a Shrine Rule○Demo: Follow a Dotted Package Import○Exercise: Read an Atlas Record✦Module Quiz
○Echo Tower: The Base Case○Echo Tower: Sum the Signals○Echo Tower: Tune the Frequencies○Echo Tower: Select Beacon Labels✦Module Quiz
○Exit Gate: Reading Object Vocabulary○Final Game Mission: Open the Exit Gate✦Module Quiz

Project: Unlock the Exit Gate

Adi needs two safe steps to reach this level's exit beacon. Tile 2 is broken. Map the other tiles in order, stop once you have enough steps, and report whether the gate can open.

This project combines the loop, skip, stop, and branch patterns you have practiced. The starter supplies the route limit and print calls. In main.py, build the path above the gate_status assignment, then replace that placeholder with a decision after the loop.

Press Run after each change and Submit to check your progress. The completed program should show:

text
Path: 1 3
Steps: 2
Gate: Unlocked

There is a space after each tile in the path string. If you temporarily raise gate_limit to 8, only five safe tiles are available, so the final status should be Sealed. Restore the limit to 2 before finishing.

Your Task

  1. Build path with a loop over tiles 1 through 6: skip tile 2 with continue, and for each safe tile append f"{tile} " to path and increase steps by 1.
  2. After counting a safe step, use break when steps == gate_limit.
  3. After the loop, use if / else to set gate_status to "Unlocked" when steps == gate_limit, or "Sealed" otherwise.

The route now responds to both hazards and limits. In the Ability Workshop, you will put reusable pieces of code into functions.

Take the Quiz →
Files
  • ⋄main.py
Loading editor…
Press Run to execute your code.